Altium Designer爬蟲初探
Altium Designer程序定制開發 公眾號:EDA設計自動化
在網頁中爬取數據可以使用JAVA、PHP、C/C++、Python等語言,在Altium Designer中可以支持DelphiScript、EnableBasic、VBScript 和 JavaScript4種腳本語言,以下簡單介紹怎么在網頁中獲取一張網頁的數據。


參考代碼如下:
Dim xmlhttp
Dim Str
Dim Str_url
Dim note
Dim objHTMLdoc
Str_url = "http://www.baidu.com/"
'Set xmlhttp = CreateObject("MSXML2.XMLHTTP")
'Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlhttp.open "GET",Str_url,False
xmlhttp.Send
Str_xml =xmlhttp.responseText
MsgBox Str_xml
'創建網頁對象
Set objHTMLdoc = CreateObject("htmlfile")'
objHTMLdoc.designMode = "on"
objHTMLdoc.Write Str_xml
Set title_tag = objHTMLdoc.getElementsByTagName("title")
Value= title_tag.Length
If Value > 0 Then
MsgBox title_tag(0).innerText
End If
Set xmlhttp = Nothing
浙公網安備 33010602011771號