Code Monkey home page Code Monkey logo

Comments (7)

ThinkHao avatar ThinkHao commented on May 22, 2024 1

用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?

如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同

经过测试发现,是由于pip安装的redis库太新导致的,换成redis==2.10.6就可以正常用了。

from proxypool.

freedomkkk avatar freedomkkk commented on May 22, 2024

我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.

ThinkHao avatar ThinkHao commented on May 22, 2024

用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?

from proxypool.

freedomkkk avatar freedomkkk commented on May 22, 2024

用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?

如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同

from proxypool.

ThinkHao avatar ThinkHao commented on May 22, 2024

用之前运行正常的Windows试了下,也出现这个错误了。莫非是代理网站的网页结构变了,导致抓到的内容不符合要求了?

如果是这样的话,那这个可能性很高,这个作者的另一个代理池代码可以用https://github.com/Germey/ProxyPool,里面爬的网站代码内容部分相同,部分不同

是的,亲测有效。

from proxypool.

freedomkkk avatar freedomkkk commented on May 22, 2024

用之前运行正常的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.

ThinkHao avatar ThinkHao commented on May 22, 2024

用之前运行正常的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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.