我需要以一种形式设置输入值,获得响应后输入仍为空。
我试图将assert(splash:wait(1))
设置为assert(splash:wait(10))
,以等待页面加载,但是没有用:
script ="""
function main(splash,args)
assert(splash:go(args.url))
assert(splash:wait(1))
local entries = splash:history()
local last_response = entries[#entries].response
assert(splash:runjs('document.getElementById("email").value =
"1dfsdfsdf@dsfs.Com4"'))
assert(splash:runjs('document.getElementById("email").value ="54654")
local element = splash:select('#verification_code')
local bounds = element:bounds()
assert(element:mouse_click{x=bounds.width/2, y=bounds.height/2})
assert(splash:wait(1))
return {
url = splash:url(),
headers = last_response.headers,
http_status = last_response.status,
cookies = splash:get_cookies(),
html = splash:html(),
email = splash:select("#email").node.outerHTML,
phone = splash:select("#phone").node.outerHTML
}
end
"""
输入内容为空:
<input type="text" name="email" id="email" value=""> <input type="text" name="phone" id="phone" value="" >