-2
我正在使用以下經典ASP代碼從網頁之一提取內容。正則表達式提取HTML下拉標記 - 經典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)
我試圖犯規顯示任何 – user580950
試試我的更新..你的幫助我的朋友 – basher
十分感謝:) – user580950