GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - liukelin/Python: scrapy爬虫、selenium自动化浏览器工具、网易裤子处理。demo

BranchesTags
Open more actions menu

Latest commit

 

History

72 Commits
72 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
get_html
get_html
 
 
netease_mail
netease_mail
 
 
python3_demo
python3_demo
 
 
rabbitmq
rabbitmq
 
 
selenium
selenium
 
 
.DS_Store
.DS_Store
 
 
README.md
README.md
 
 
pid_test.py
pid_test.py
 
 
test.py
test.py
 
 

Repository files navigation

== pid_test.py ==

分布式并发下唯一ID的生成规则 (python 多线程模拟并发 ,QPS以秒为单位, 不考虑 python GIL)

1.使用 redis 的 incr (redis 为单线程, 原子性操作)

1.incr 原子性操作即返回加1操作后的值,可直接使用。避免多操作而使用事务。

2.持久性:只有一个key,可开启RDB/AOF,或者判断在nosql key失效时,获取DB表中最后一个生成的id并set写入,保持可持续使用。

3.性能:内存操作,性能优良

4.灾难恢复,数据自动恢复,脚本检测set进最后一个生成的ID

redis> SET mykey "10"

OK

redis> INCR mykey

(integer) 11

redis> GET mykey

"11"

2.使用 mysql 表的唯一自增主键 (可用双实例/物理机 错开id(奇偶数 +1/+2))

1.mysql的原子性,可保证自增列不会产生重复的id

2.持久性:存在于mysql数据表中,持久化于磁盘

3.性能:数据写入操作,可用错开id(+1/+2)双写

== /demo/get_all_image.py == 多线程 获取本计算机下所有图片并保存

== selenium 的使用 ==

1.百度贴吧自动登录、签到

运行脚本: tieba.py

环境: python3

依赖库: pip install selenium , requests

使用的接口为无验证码接口,有验证码的话请自行实现。

登录过程使用selenium webdriver操作并获取登录cookie,签到过程为请求签到接口

=== netease_mail 网易裤子的碰撞 ===

将52G网易裤子,导入redis,进行查找

set_mail_redis.py
网上抓到一批带*邮箱(130****[email protected]、xxxx***@163.com),需要进行碰撞匹配

将52G邮箱导入redis,并匹配
类型1手机邮箱:130****[email protected]    [:3]+[-4:]为key    
类型2普通邮箱:xxxx***@163.com		[:-3]为key  

服务器内存才16G,所以分批 导入-匹配-flushdb。
关闭redis rdb、aof 提高性能

@author: liukelin [email protected]

About

scrapy爬虫、selenium自动化浏览器工具、网易裤子处理。demo

Topics

python

Resources

Readme
Activity

Stars

7 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.