我试着从一家特定酒店的页面上找出过去28天的房费。我怀疑我被屏蔽了,但我不是很确定。
我得到了一些结果,但不是全部。我甚至尝试过不同的用户代理,download_delay为30,支持httpcahce等。
这是我的lua脚本
function main(splash, args)
splash.private_mode_enabled = false
splash.js_enabled = true
splash.images_enabled = false
assert(splash:go(args.url))
function wait_for(splash, condition)
while not condition() do
splash:wait(20.0)
end
end
wait_for(splash, function()
return splash:evaljs("document.querySelector('ul.availability-table-revamp') != null")
end)
assert(splash:wait(30.0))
splash:set_viewport_full()
return {
html = splash:html(),
}
end我正在爬行的页面在这里。
我如何才能确定是页面阻止了我?酒店页面上没有政策--但(当然)在引擎的主页上有……
当然,我确实有更多的代码要展示,但我猜唯一可以解决这个问题的就是lua。但是如果你想了解更多,完整的代码是here :-)
当然希望你比我聪明(我想我已经知道答案了)。
发布于 2019-01-05 00:47:01
有时web会阻止用户的ip,请尝试使用不同的proxy servers,因为它可以通过我的系统访问。
https://stackoverflow.com/questions/54042226
复制相似问题