我正在尝试创建一个程序,在两个单独的输入框中询问用户他们的用户名和密码,然后打开Internet Explorer,然后转到facebook.com并输入用户名和密码并登录。好吧,当我运行你在底部看到的代码它不起作用,因为出于某种原因,当它打开时没有选择Internet Explorer,所以我必须点击它,它永远不会输入用户名或密码!
CODE:
Option Explicit
Dim ie, x
Set ie = createobject("InternetExplorer.Application")
Set x = createobject("wscript.shell")
Sub Load
Do while ie.Busy
wscript.sleep 200
Loop
End Sub
ie.Navigate "https://www.facebook.com/"
ie.Toolbar=0
ie.StatusBar=0
ie.Resizable=1
ie.Visible=1
Call Load
x.sendkeys "cow"
x.sendkeys "{tab}"
x.sendkeys "pass"
答案 0 :(得分:0)
试试这个:
Option Explicit
Dim ie, x
Set ie = createobject("InternetExplorer.Application")
Set x = createobject("wscript.shell")
ie.Visible=1
ie.Toolbar=0
ie.StatusBar=0
ie.Resizable=1
Sub Load
Do while ie.Busy
wscript.sleep 100
Loop
End Sub
x.AppActivate "Microsoft Internet Explorer"
ie.Navigate "https://www.facebook.com/"
Call Load
x.sendkeys "cow"
x.sendkeys "{tab}"
x.sendkeys "pass"
主要的外卖是 -