Skip to content

nroskill/CrawlerForLeetcodeMyAnswers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CrawlerForLeetcodeMyAnswers

支持的、经过测试的Python版本:

  • 2.7.12
  • 3.6.1

使用方法:

python crawler.py [username password][problem_id]

其中problem_id为指定题号,如果不指定则默认爬取所有AC过的题,但不会爬取本地已经爬到过的题

注:如果多次AC,只会爬取最新的答案,如需更新,请删除之前的版本,或使用problem_id参数强制爬取

可以根据自己情况修改config.py, 包括

  • 代理
  • 登陆信息
  • 语言类型限制(如果本地存在该题的任意语言的答案,也不会重新爬取)
  • 输出文件的编码类型
  • 并发数上限(多进程)
  • header(一般不用改)
  • 语言相关设置(一般不用改)

注:会优先使用参数中的用户名和密码

例如 只爬取题目id为100的题(需要修改config.json中的login和password)

python crawler.py 100

例如 在参数中使用用户名和密码爬取

python crawler.py nroskill 123456

也可以同时使用

python crawler.py nroskill 123456 100

About

爬自己leetcode上写过的题的答案

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages