任何人都可以用一个简单的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