问题描述
我正在尝试获取单击 div 元素后出现的弹出窗口的 HTML 代码。但出于某种原因,Splash 不想渲染它。
我正在使用以下脚本:
function main(splash,args)
splash.private_mode_enabled = false
splash:set_user_agent('Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36(KHTML,like Gecko) Chrome/48.0.2564.116 Safari/537.36 OPR/35.0.2066.92')
assert(splash:go(args.url))
assert(splash:wait(6))
local btn = splash:select_all('body > main > div > div:nth-child(2) > div > div.ProductDetailsPage83__productDetailsGrid > div.ProductDetails83 > div.SizeChartLink83.SizeChartLink83__sizeGuide.undefined > span > a > div')[1]
assert(btn:mouse_click())
assert(splash:wait(10))
return {
html = splash:HTML(),png = splash:png(),}
end
更新:
据我了解,出现点击按钮的情况,但不知什么原因对页面的HTML代码没有任何影响,我还是只看到了主页的代码,而不是弹窗代码
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)