我制作了一个运行良好的 vbscript,以为我可以将它插入带有脚本标签的 html 中,它会执行相同的操作。不正确,请告诉我我需要做什么才能让按钮工作。作为一个脚本,它会自动登录并导航到一个页面,我希望在我的网页上按下按钮时发生这种情况。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add a Lead</title>
<script type="text/vbscript">
function Execute()
{
Dim IE
Dim WRI
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 1
IE.navigate "http://rentalapp.zillow.com/"
Do While (IE.Busy)
WScript.Sleep 10
Loop
Set WRI = IE.document.getElementByID("username")
WRI.Value = "username"
Set WRI = IE.document.getElementByID("password")
WRI.Value = "password"
Set WRI = IE.document.Forms(0)
WRI.Submit
WScript.Sleep 801
IE.navigate "http://rentalapp.zillow.com/leads/add/"
document.getElementById("field2").value=document.getElementById("field1").value; } </script> </head>
<body>
<button onclick="Execute()">Add A Lead</button>
</body>
</html>
请帮忙