czy1999 / weibo-topic-spider

微博超级话题爬虫,微博词频统计+情感分析+简单分类,新增肺炎超话爬取数据
MIT License
269 stars 65 forks source link

相关问题 #3

Closed xtll closed 4 years ago

xtll commented 4 years ago

报错: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element

...
is not clickable at point (240, 643). Other element would receive the click:
...
(Session info: chrome=79.0.3945.130) 好像是窗口大小问题,不知道该如何解决

czy1999 commented 4 years ago

我这边测试正常,请问报错的代码行数和爬取的话题是什么?

xtll commented 4 years ago

全部错误代码: Traceback (most recent call last): File "D:/pycharm/weibo3.0/weibo-topic.py", line 198, in spider(username, password, driver, book_name_xls, sheet_name_xls, keyword, maxWeibo) File "D:/pycharm/weibo3.0/weibo-topic.py", line 174, in spider elem.click() File "C:\Users\tkx\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click self._execute(Command.CLICK_ELEMENT) File "C:\Users\tkx\Anaconda3\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute return self._parent.execute(command, params) File "C:\Users\tkx\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\tkx\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element

...
is not clickable at point (240, 643). Other element would receive the click:
...
(Session info: chrome=79.0.3945.130) 爬取话题为:江苏响水爆炸

czy1999 commented 4 years ago

知道问题所在了,本项目是微博超级话题爬虫,而“江苏响水爆炸”不是微博超级话题,程序找不到超级话题框,所以报错了,我稍微修改了一下,你可以直接运行下面的代码爬取关于江苏响水爆炸的微博数据(将以下代码覆盖粘贴到weibo-topic-spyder.py,其他项目文件不变)

weibo-topic-spyder.txt

czy1999 commented 4 years ago

项目已更新,添加普通话题爬取代码