我的问题与这篇文章密切相关:Splash 不会呈现整个页面
我无法以呈现以下网站的动态部分的方式配置启动:
https://www.wunderground.com/history/daily/ro/slava-cerchez%C4%83/LRTC/date/2018-8-03?cm_ven=localwx_history
页面如下所示
但它应该看起来像这样
这是启动脚本:
function main(splash, args)
assert(splash:go(args.url))
assert(splash:wait(5))
splash:set_viewport_full()
splash.private_mode_enabled = false
splash.indexeddb_enabled = true
splash.html5_media_enabled = true
return {
html = splash:html(),
png = splash:png(),
har = splash:har(),
}
end
我已经尝试增加等待时间并禁用私人模式。如果有人能给出如何正确配置splash的提示,以便它呈现java脚本部分,我将非常高兴。
我对该网站的历史天气数据也有同样的问题。我无法弄清楚如何使用 Splash 渲染页面。但是,使用Seleuium驱动的浏览器似乎可以正确呈现页面。这并不理想,因为您实际上必须呈现页面,但它可以工作。
硒:https://selenium-python.readthedocs.io/installation.html