ma63d / leetcode-spider Goto Github PK
View Code? Open in Web Editor NEW用 node.js 爬你自己的 leetcode 解题源码
用 node.js 爬你自己的 leetcode 解题源码
运行lc-spider,报错,信息如下,不太懂这个东西,求大佬解决~
/usr/local/lib/node_modules/leetcode-spider/lib/spider.js:140
let [, body] = yield request.get('/api/problems/algorithms/')
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/usr/local/lib/node_modules/leetcode-spider/lib/entry.js:53:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
第一个是多个session的时候,generateMD.js生成的README.md里面的I've solved xxx/xxx problems (xx problems for a fee).
能够把所有session算在一起,其实有个简单办法就是看本目录里面有多少个就说明solved多少个,然后再爬一个总题数。
第二个是提供cookie选项,而可以免帐号密码,这样爬完之后,自己再打开leetcode就不用重新登录了。
很好用的爬虫,谢谢!
今天在使用leetcode-spider的时候一直报错,其报错信息如下:
[10:21:26] [lc-spider] INFO - token get
[10:21:28] [lc-spider] INFO - login successfully
[10:21:46] [lc-spider] ERROR - { Error: socket hang up
at createHangUpError (_http_client.js:254:15)
at TLSSocket.socketOnEnd (_http_client.js:346:23)
at emitNone (events.js:91:20)
at TLSSocket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' }
[10:21:46] [lc-spider] ERROR - Error: socket hang up
at createHangUpError (_http_client.js:254:15)
at TLSSocket.socketOnEnd (_http_client.js:346:23)
at emitNone (events.js:91:20)
at TLSSocket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
运行未出错,但是没有solution,只有问题的描述
前两天还能正常用的,现在就 incorrect username or password 了,应该是 LeetCode 反爬虫策略改了。
network error: cannot get csrftoken
你好,获取不了csrftoken,是undefined,求解决,谢谢!
请教一下 我试了好几次都是incorrect username or password, 试了两个账户都是这个error,username和password应该都没错,不知道是哪里出了问题
最近爬下来的题的难度指数不太对,和lc网站上显示的有出入
easy的题会显示成hard,medium的题会显示成easy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.