我的客户希望在他的网站上放置一个按钮,该按钮可以在他们不托管或无法访问服务器的第三方网站上触发操作,这意味着现在必须将代码嵌入 HTML 代码中。
该按钮不公开,它是某些员工的通用登录。
<!doctype html>
<html>
<head>
<title>Add a Lead</title>
</head>
<script type="text/vbscript">
sub 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 1000
IE.navigate "http://rentalapp.zillow.com/leads/add/"
end sub
</script>
<body>
<button onClick="Execute()">Add A Lead</button>
This is supposed to fire off the method called execute.
</body>
</html>