getter引入协程,tester中aiohttp的session优化#92
Open
Hui4401 wants to merge 2 commits intoPython3WebSpider:masterfrom
Open
getter引入协程,tester中aiohttp的session优化#92Hui4401 wants to merge 2 commits intoPython3WebSpider:masterfrom
Hui4401 wants to merge 2 commits intoPython3WebSpider:masterfrom
Conversation
Hui4401
commented
Sep 1, 2020
- crawler 中的爬取任务改用协程并发完成,由于异步方式,无法用 logger 记录当前正在爬取的网页了
- data5u.py 中重写的爬取方法也做了相应修改
- 原 tester 中,测试每个 proxy 都创建了一个 aiohttp.ClientSession,这有点浪费没有复用 session 的连接池,所以我增加了一个 main 方法用一个 session 处理了所有的代理测试。
Member
|
感谢贡献,我看其他的 Crawler 的 async 逻辑没有修改,这个其他的 Crawler 就没法用了吧,能麻烦一并修改下吗? |
Author
|
Member
|
多谢贡献,我会测试一下,没问题就 merge。 |
Contributor
|
aiohttp 不支持 https 代理,这个比较不好,感觉没必要改成这样 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.