Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
访问VBA getelementsbytagname windows 10问题?_Vba_Internet Explorer 11_Ms Access 2013 - Fatal编程技术网

访问VBA getelementsbytagname windows 10问题?

访问VBA getelementsbytagname windows 10问题?,vba,internet-explorer-11,ms-access-2013,Vba,Internet Explorer 11,Ms Access 2013,我可以使用VBA脚本从多个网站提取数据。它们与office 2013和Windows 7完美配合。然而,自从升级到Windows 10后,我一直收到间歇性错误(不一定在同一个地方有相同的数据),或者有时没有从标记中提取数据。当我访问带有特定索引的特定标记时,也会出现这种情况,例如 tempV = TDelement.getElementsByTagName("td")(0).innerText 我使用IE作为浏览器对象,创建如下: Set objIE = CreateObject("Inter

我可以使用VBA脚本从多个网站提取数据。它们与office 2013和Windows 7完美配合。然而,自从升级到Windows 10后,我一直收到间歇性错误(不一定在同一个地方有相同的数据),或者有时没有从标记中提取数据。当我访问带有特定索引的特定标记时,也会出现这种情况,例如

tempV = TDelement.getElementsByTagName("td")(0).innerText
我使用IE作为浏览器对象,创建如下:

Set objIE = CreateObject("InternetExplorer.Application")

升级Windows时是否有可能损坏的内容?(新手,对于任何不正确的术语表示歉意)

考虑使用MSXML对象进行web服务器请求。IE不再是Windows上的专用浏览器,因此可能无法完全支持Windows 10的自动化

Dim Req As Object, xmlobj As Object
Dim strWeb As String, myFile As String

' READ HTML PAGE
Set Req = CreateObject("MSXML2.XMLHTTP")
Req.Open "GET", "http://www.example.coms/", False
Req.send

' HTML/TEXT
strWeb = Req.responseText
myFile = "C:\Path\To\File.txt"
Open myFile For Output As #1
Write #1, strWeb
Close #1

' XML
Set xmlObj = CreateObject("MSXML2.DOMDocument")
myFile = "C:\Path\To\File.xml"
xmlObj.LoadXML Req.responseText
xmlObj.Save myFile

Set Req = Nothing
Set xmlObj = Nothing

请使用反勾号正确设置代码表达式的格式。例如:
返回Rx.Observable.fromPromise(jQuery.getJSON(requestUrl))
。它使您的代码更具可读性,并提高了您获得answerNo HTML或URL的机会,以感谢您的回复。我将在稍后发布结果。我使用IE对象的主要原因是为了避免必须编写代码才能登录到站点,因为我只能在浏览器上登录。看起来像这样懒惰的人在将来可能不是一个选择:(