我正在尝试使用excel vba自动执行浏览器任务。需要打一些网址以进行测试。我试图在循环中命中每个URL,但是每次IE浏览器都在同一会话中打开。
我正在尝试使用excel vba自动执行浏览器任务。需要打一些网址以进行测试。我试图在循环中命中每个URL,但是每次IE浏览器都在同一会话中打开。请帮助修改代码以每次打开关闭会话,然后在新的会话eveytime中打开。
Sub test()
' open IE, navigate to the desired page and loop until fully loaded
Set IE = CreateObject("InternetExplorer.Application")
my_url = "*****UL*******"
With IE
.Visible = True
.Navigate my_url
End With
Application.Wait (Now() + TimeValue("0:00:10"))
Application.SendKeys "Username"
Application.SendKeys "{TAB}"
Application.Wait (Now() + TimeValue("0:00:10"))
Application.SendKeys "Password"
Application.SendKeys "{TAB}"
Application.SendKeys "{RETURN}"
Do Until Not IE.Busy And IE.readyState = 4
DoEvents
Loop
Set IE = Nothing
End Sub
提取IE弓箭每次都将在新会话中打开。请帮助修改代码