Tag: 互联网浏览器的

Browser.Document.frames工作在另一台计算机上

我有一个Excel VBA工作在一台计算机上,但在其他计算机上出现错误。 这是我使用的代码: Set Browser = New InternetExplorer Browser.navigate "http://core.purus.se/PurusWeb/common/frameset.aspx? Profile=Sweden&NamedPath=Golvbrunnar" Do While Browser.Busy: DoEvents: Loop: Do Until Browser.readyState = READYSTATE_COMPLETE: DoEvents: Loop Sleep 100 Browser.Visible = True Set Document = Browser.Document.frames("Main").Document Set htmlColl = Document.getElementsByTagName("a") 这是错误信息:“… -2147352319(80020101)…对象'JScriptTypeInfo'中的'frames'…” 我得到行上的错误:“设置文档….” 它运行的计算机有WindowsVista 32位,InternetExplorer 9和MS Office 2007.得到错误的计算机有Windows7 64位,InternetExplorer 11和MS Office 2010。

修改数据检索macros

我有下面的代码,从两个页面,需要login拉表。 代码打开IE浏览器,进入login页面,放入证书,然后拉2个表。 但是,如果IE已经与用户login,它会直接将您带到此页面(因此没有login字段,因此代码错误): https : //www.example.com/taskprocessing/manage.jsp 我需要添加一条IF语句,如果它login到此页面上,单击此链接注销,然后继续使用凭​​据login: https : //www.example.com/taskprocessing/logout.jsp Sub GetTable() Set ie = CreateObject("InternetExplorer.Application") With ie .Visible = True .Navigate "https://www.example.com/taskprocessing/login.jsp" Do Until .ReadyState = 4 DoEvents Loop .Document.all.Item("Username").Value = "username123" .Document.all.Item("Password").Value = "password123" .Document.forms(0).submit End With With ActiveSheet.QueryTables.Add(Connection:= _ "URL;https://www.example.com/taskprocessing/report_pending_tasks.jsp", Destination:=Range("J1")) .WebSelectionType = xlAllTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = […]

VBA脚本在Intranet上失败

我目前正在使用Office 2010,Visual Basic for Applications 7和Internet Explorer 9。 目前我遇到的问题是,使用IE对象似乎在我们的内部网上失败,我想知道是否有这个修复。 function代码: Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") IE.Navigate "http://www.google.com" WaitUntilReady IE 'Application.Wait (Now + TimeValue("00:00:10")) 'IE.Visible = True MsgBox (IE.Document.body.innerHTML) 破码: Dim IE As Object Set IE = CreateObject("InternetExplorer.Application") IE.Navigate "http://intranet/" WaitUntilReady IE 'Application.Wait (Now + TimeValue("00:00:10")) 'IE.Visible = True MsgBox (IE.Document.body.innerHTML) function代码完全是它应该的。 创build一个IE对象,该对象不会在屏幕上显示,并返回带有google.com的HTML代码内容的消息框 […]

VBA InternetExplorer.Application对象挂起

我正在使用VBA的旧Excel文档,可以在Windows 7上使用IE 11,但是在Windows 10上的IE 11上不起作用。 IE 11启动到请求的URL,但就是这样。 任何时候我尝试访问一个事件,方法或属性,它会停止。 没有错误代码,没有崩溃,只是停止。 我已经确认包含了我对Microsoft Internet控件和Microsoft HTML对象库的引用(它们不是,但现在是它们)。 Dim ie As Object If ie Is Nothing Then Set ie = CreateObject("InternetExplorer.Application") ie.Visible = True End If url = "www.myurl.com" ie.Navigate url While ie.ReadyState <> 4 Or ie.Busy: DoEvents: Wend 检查代码从不执行,我把MsgBox代码放在testing之前和之后。 只有MsgBox之前的循环工作,除非我尝试使用MsgBox ie.Document.Title ,但我可以做MsgBox ie.ReadyState或MsgBox "Loading webpage"就好了。 再次,代码工作完全没有问题,在IE 11的Windows 7上,但不能在IE 10的Windows 10上工作。在多个W7和W10机器上testing,结果相同。

VBA脚本来抓取一个HTML元素的值

我看了大约30个不同的问题,每个问题都涉及到“getelementbyID”。 我的问题是我需要刮的元素没有ID: 我看到它是在“h6”类或标签内,但是 msgbox IEObj.Document.getelementsbytagname("h6").Value msgbox IEObj.Document.getelementsbyclassname("h6").Value 只是返回“对象不支持这个属性或方法”。 我究竟做错了什么?? (代码的其余部分只是设置一个名为IEObj的IE对象,并导航到这个页面,所以它是不重要的)。

VBA / VBscripting自动化的Web Scraping循环与IElogin

我一直在试图编写一个脚本,将网站在渲染网站上的某个字段/标签。 该网站与Excel中的列列表中的search参数呈现。 Appox 20个项目将会增长。 在研究如何使用vbscript来抓取网页之后,我遇到的问题是如何做20次而不会中断。 这是我的代码。 Excel列 1492565 1528417 1529041 1530688 1492038 1492319 1492972 1508824 1513351 1514724 1514750 1518526 1520627 1520706 1520979 1523367 1523563 Script:Main sub(从excelinput字段获取用户名/密码,通过特定列上的行设置循环,只有吐出msgbox才能使循环工作,然后输出到另一列 Sub WebScrapper() 'itg on mainWS start row 6, column 5 'itg status column column 19 'declare variables Dim url As String Dim ITGNUMBER As Long Dim user As String […]

在Visual Basic中使用IE浏览器

努力寻找解决scheme。 从Visual Basic(更具体地说,Excel中的VBA)我可以通过使用标题来调用Internet Explorer窗口 AppActivate ("My Page Title – Windows Internet Explorer") 而且每次都很棒。 我可以打开一个新的窗口,并使用..发送一个url Dim ie As Object Set ie = New InternetExplorer ie.Visible = True ie.Navigate "http://websiteurl" 而且,这也可以工作好但是它每次打开一个新的浏览器,我希望它总是调用相同的窗口。 所以我可以设置ie每次相同的页面。 所以,而不是 Set ie = New InternetExplorer 它做了类似的事情 Set ie = ACTIVE InternetExplorer (尽pipe这似乎并不存在)。 有一些设置方式, ie与AppActivate ("My Page Title – Internet Explorer")吗? 谢谢 完整代码在这里: Sub Find_Recordings() […]