Dom 在VBScript中将responseText解析为HTML
我试图从responseText创建的字符串变量中检索HTML类名。我需要使用VBscript来完成这项工作。以下是当前代码的示例:Dom 在VBScript中将responseText解析为HTML,dom,vbscript,xmlhttprequest,Dom,Vbscript,Xmlhttprequest,我试图从responseText创建的字符串变量中检索HTML类名。我需要使用VBscript来完成这项工作。以下是当前代码的示例: set http = createobject("Microsoft.XmlHttp") http.open "GET","http://www.xxxxxxxxxxx.com/xxx-xxx?xxxxNumber=xxxxx",false http.send "" dim html : set html = CreateObject("HTML
set http = createobject("Microsoft.XmlHttp")
http.open "GET","http://www.xxxxxxxxxxx.com/xxx-xxx?xxxxNumber=xxxxx",false
http.send ""
dim html : set html = CreateObject("HTMLFILE")
html.write http.responseText
dim trackdate : trackdate = html.getElementByClassName("tracking-history-date").[0].value
wscript.echo trackdate
我收到以下错误:对象不支持此属性或方法:“getElementByClassName”我以前遇到过此问题。尽管如此,
getElementsByClassName()
方法似乎实际上不受支持。使用类似这样的方法来解决问题:
For Each el In html.getElementsByTagName("...")
If el.ClassName = "tracking-history-date" Then
Set trackdate = el
Exit For
End If
Next
感谢Ansgar提供的信息,但不幸的是,我收到了一个错误:所需对象:“”@jrobinson6274请使用产生此错误的修改代码更新您的问题。你把什么作为标签名?