【发布时间】:2018-02-20 04:53:08
【问题描述】:
我正在尝试爬取this page 但是页面卡在加载中。
我正在使用 Scrapy==1.5.0 scrapy-splash==0.7.2
我什至将等待时间更改为 7 秒。但问题仍然存在。有什么解决办法吗?
【问题讨论】:
标签: web-scraping scrapy scrapy-splash
我正在尝试爬取this page 但是页面卡在加载中。
我正在使用 Scrapy==1.5.0 scrapy-splash==0.7.2
我什至将等待时间更改为 7 秒。但问题仍然存在。有什么解决办法吗?
【问题讨论】:
标签: web-scraping scrapy scrapy-splash
尝试使用 wait_for_element lua 脚本来确保加载您所追求的 html。它可能需要超过 7 秒的时间,但至少它会加载元素而不需要固定的超时时间。 Splash 加载页面的时间可能比常规网络浏览器长。
https://github.com/scrapinghub/splash/blob/master/splash/examples/wait-for-element.lua
【讨论】: