任何人都可以用一個簡單的vbs腳本來幫助我,它將字段qwidget_lastsale從此站點複製到excel表單中?vbs將文本從IE複製到Excel
http://www.nasdaq.com/symbol/abt/recommendations
我一直在試圖修改現有腳本,但似乎無法使它發揮作用。 Sofar我可以打開該網站和excel,但不能複製該字段。
我想有此之後,複製腳本:
Set objExplorer = CreateObject("InternetExplorer.Application")
WebSite = "http://www.nasdaq.com/symbol/abt/recommendations"
with objExplorer
.Navigate2 WebSite
.left=5
.top=5
.height=1100
.width=700
.AddressBar = 0
.Visible = 1
.ToolBar = 0
.StatusBar = 1
WScript.Sleep 1000
Set objIE = Nothing
end with
Set xl = CreateObject("Excel.application")
xl.Application.Workbooks.Open "C:\Users\user\Documents\testauto.xlsx"
xl.Application.Visible = True
問候 user24
感謝您的提示和建議。我想繼續使用宏芒建議,但我得到一個錯誤:對象不支持此屬性或方法'objExplorer.Document.getElementByID(...)。值。代碼800A01B6。我能否在頁面上選擇了錯誤的元素,或者爲什麼不支持? – user24
我設法使用.innerText而不是.Value來處理上述建議。謝謝你的幫助。 – user24