Comments (7)
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同
经过测试发现,是由于pip安装的redis库太新导致的,换成redis==2.10.6就可以正常用了。
from proxypool.
我Windows上就出现这个问题了,同问怎么解决?
代理池开始运行
- Serving Flask app "proxypool.api" (lazy loading)
- Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead. - Debug mode: off
- Running on http://0.0.0.0:5555/ (Press CTRL+C to quit)
开始抓取代理
获取器开始执行
Crawling http://www.66ip.cn/1.html
正在抓取 http://www.66ip.cn/1.html
抓取成功 http://www.66ip.cn/1.html 521
Crawling http://www.66ip.cn/2.html
正在抓取 http://www.66ip.cn/2.html
抓取成功 http://www.66ip.cn/2.html 521
Crawling http://www.66ip.cn/3.html
正在抓取 http://www.66ip.cn/3.html
抓取成功 http://www.66ip.cn/3.html 521
Crawling http://www.66ip.cn/4.html
正在抓取 http://www.66ip.cn/4.html
抓取成功 http://www.66ip.cn/4.html 521
正在抓取 http://www.ip3366.net/?stype=1&page=1
抓取成功 http://www.ip3366.net/?stype=1&page=1 200
成功获取到代理 115.46.74.213:8123
成功获取到代理 138.255.39.17:47019
成功获取到代理 80.211.57.195:3128
成功获取到代理 45.234.202.1:53281
成功获取到代理 221.8.165.2:80
成功获取到代理 168.197.113.132:34241
成功获取到代理 45.236.107.37:42244
成功获取到代理 27.203.241.4:8060
成功获取到代理 27.208.29.24:8060
成功获取到代理 103.116.38.9:40280
正在抓取 http://www.ip3366.net/?stype=1&page=2
抓取成功 http://www.ip3366.net/?stype=1&page=2 200
成功获取到代理 59.125.31.116:45965
成功获取到代理 103.217.154.92:23500
成功获取到代理 113.16.240.142:8118
成功获取到代理 103.218.133.216:50567
成功获取到代理 103.47.239.159:42430
成功获取到代理 112.87.254.81:8118
成功获取到代理 103.115.180.96:42556
成功获取到代理 103.218.25.52:53281
成功获取到代理 80.211.55.179:3128
成功获取到代理 137.59.162.178:52497
正在抓取 http://www.ip3366.net/?stype=1&page=3
抓取成功 http://www.ip3366.net/?stype=1&page=3 200
成功获取到代理 165.90.209.141:31975
成功获取到代理 80.211.84.179:3128
成功获取到代理 103.108.96.159:46258
成功获取到代理 103.106.101.12:45100
成功获取到代理 112.84.85.164:8118
成功获取到代理 183.172.131.4:8118
成功获取到代理 112.67.35.134:8118
成功获取到代理 59.110.48.236:3128
成功获取到代理 111.224.137.25:80
成功获取到代理 138.121.31.108:53281
Process Process-2:
Traceback (most recent call last):
File "D:\Program Files\Python\Python36\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "D:\Program Files\Python\Python36\lib\multiprocessing\process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "F:\pythonex\ProxyPool-master\proxypool\scheduler.py", line 28, in schedule_getter
getter.run()
File "F:\pythonex\ProxyPool-master\proxypool\getter.py", line 30, in run
self.redis.add(proxy)
File "F:\pythonex\ProxyPool-master\proxypool\db.py", line 30, in add
return self.db.zadd(REDIS_KEY, score, proxy)
File "D:\Program Files\Python\Python36\lib\site-packages\redis\client.py", line 2263, in zadd
for pair in iteritems(mapping):
File "D:\Program Files\Python\Python36\lib\site-packages\redis_compat.py", line 123, in iteritems
return iter(x.items())
AttributeError: 'int' object has no attribute 'items'
from proxypool.
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
from proxypool.
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同
from proxypool.
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同
是的,亲测有效。
from proxypool.
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同
经过测试发现,是由于pip安装的redis库太新导致的,换成redis==2.10.6就可以正常用了。
的确是这样,我发现最新版Redis的zadd和zincrby函数出现了变化,把程序文件db.py的这两个函数改为self.db.zadd(REDIS_KEY, {proxy: score}) ; self.db.zadd(REDIS_KEY, {proxy: MAX_SCORE});self.db.zincrby(REDIS_KEY, -1, proxy)就能成功运行了
from proxypool.
用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?
如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同
经过测试发现,是由于pip安装的redis库太新导致的,换成redis==2.10.6就可以正常用了。
的确是这样,我发现最新版Redis的zadd和zincrby函数出现了变化,把程序文件db.py的这两个函数改为self.db.zadd(REDIS_KEY, {proxy: score}) ; self.db.zadd(REDIS_KEY, {proxy: MAX_SCORE});self.db.zincrby(REDIS_KEY, -1, proxy)就能成功运行了
哈哈,折腾一下总有收获。
from proxypool.
Related Issues (20)
- 修改源码后Dockerfile重新build镜像报错 HOT 4
- Windows 环境下常规方式运行会重复多次启动进程
- 大佬, IP是从哪个网站获取的啊 HOT 1
- 为什么验证的返回的结果仍会带有本地ip, HOT 6
- tester报错:TypeError: Passing coroutines is forbidden, use tasks explicitly. HOT 2
- 没有模块报错
- 建议接口增加[返回代理数量]参数 HOT 1
- 建议接口增加[返回代理数量]参数
- mac 上使用 docker 部署出错。 HOT 4
- 怎么解决python11下运行run,py后报ImportError: cannot import name 'ProxySchemeUnsupported' from 'requests.packages.urllib3.exceptions'的问题? HOT 2
- Proxy, transparente
- Proxy
- It occurs an error when running the run.py on the 'run_tester' function HOT 1
- 无法正常获取代理 HOT 1
- 无法连接到localhost:5555,ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 HOT 3
- 运行过程中有错误
- Windows 常规运行没反应
- [enhancement] 拟增加一些代理SCORE的参数settings,以便能更灵活的通过random获取代理
- 使用random请求一直获得同一个 HOT 3
- docker 运行ProxyPool后,VPS空间被占满了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxypool.