我正在使用以下经典 ASP 代码从其中一个网页中提取内容。
该网页有一个选择框,我想做的是仅在响应中显示该选择框,所以不确定我应该在这里更改什么strPattern = "<select>(.*?)<\/select>"
我需要访问的 HTML 下拉代码
<select onchange="change_option('SELECT___MC-TRIMC350___56',this.options[this.selectedIndex].value)" name="SELECT___MC-TRIMC350___56" class=" PIN_1373378891415_hazClick">
<option value="634">1 GAL [$64.99]</option>
<option value="629" class=" PIN_1373378891415_hazClick">5 GAL PAIL [$144.99]</option>
<option value="637">54 GAL DRUM [$2,225.00]</option>
</select>
经典的 asp 代码来读取页面标题,我希望它改变,以便选择框按原样显示
Dim strURL, objXMLHTTP, objXML, strContents
Dim objRegExp, strHTML, strPattern, colMatches, strTitle
strURL= "http://abc.com/testhtm"
Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
'Or if this doesn't work then try :
'Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
objXMLHTTP.Open "GET", strURL, False
objXMLHTTP.Send
strContents = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing
Set objRegExp = New RegExp
strPattern = "<select>(.*?)<\/select>"
objRegExp.Pattern = strPattern
objRegExp.IgnoreCase = True
objRegExp.Global = True
Set colMatches = objRegExp.Execute(strContents)
If colMatches.Count > 0 then
strTitle = objMatches(0).Value
Else
strTitle = ""
End If
Set objRegExp = Nothing
Response.write(strTitle)