Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 run_spider.py user 出现问题 #318

Open
innerbboy opened this issue Feb 19, 2024 · 5 comments
Open

python3 run_spider.py user 出现问题 #318

innerbboy opened this issue Feb 19, 2024 · 5 comments

Comments

@innerbboy
Copy link

(venv) ➜ weibospider git:(master) ✗ python3 run_spider.py user
Traceback (most recent call last):
File "/Users/daiyunshan/gitproject/WeiboSpider/weibospider/run_spider.py", line 25, in
process = CrawlerProcess(settings)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/daiyunshan/gitproject/WeiboSpider/venv/lib/python3.11/site-packages/scrapy/crawler.py", line 281, in init
install_shutdown_handlers(self._signal_shutdown)
File "/Users/daiyunshan/gitproject/WeiboSpider/venv/lib/python3.11/site-packages/scrapy/utils/ossignal.py", line 19, in install_shutdown_handlers
reactor._handleSignals()
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SelectReactor' object has no attribute '_handleSignals'

@Biweihong
Copy link

我也遇到了这个问题

@nghuyong
Copy link
Owner

大概率是scrapy版本的问题,请检查一下是不是requirements中的版本

@assdssao
Copy link

同样的问题


$ python run_spider.py tweet_by_tweet_id
C:\Users\J_2\Desktop\1\WeiboSpider\weibospider\spiders\tweet_by_keyword.py:55: SyntaxWarning: invalid escape sequence '\s'
tweets_infos = re.findall('<div class="from"\s+>(.*?)', html, re.DOTALL)
Traceback (most recent call last):
File "C:\Users\J_2\Desktop\1\WeiboSpider\weibospider\run_spider.py", line 25, in
process = CrawlerProcess(settings)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AllAboutHelloWorld\Python\Lib\site-packages\scrapy\crawler.py", line 281, in init
install_shutdown_handlers(self._signal_shutdown)
File "D:\AllAboutHelloWorld\Python\Lib\site-packages\scrapy\utils\ossignal.py", line 19, in install_shutdown_handlers
reactor._handleSignals()
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SelectReactor' object has no attribute '_handleSignals'

@assdssao
Copy link

检查过依赖版本是没问题的

@myk-dorothy
Copy link

可以试一下 pip install --upgrade scrapy
升级以后我的可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants