Scrapy Splash显示在网页上加载

时间:2018-02-20 04:53:08

标签: web-scraping scrapy scrapy-splash

我试图抓取this page 但页面在加载时卡住了。

我正在使用 Scrapy == 1.5.0 scrapy飞溅== 0.7.2

我甚至将等待时间改为7秒。但问题仍然存在。任何解决方案?

enter image description here

1 个答案:

答案 0 :(得分:0)

尝试使用wait_for_element lua脚本来确保加载后的html。它可能需要超过7秒,但至少它将加载元素而不需要固定的超时。 Splash可能需要比常规Web浏览器更长的时间来加载页面。

https://github.com/scrapinghub/splash/blob/master/splash/examples/wait-for-element.lua