【发布时间】:2019-04-10 08:30:04
【问题描述】:
我是 Excel VBA 的新手,无法从以下网站提取数据:https://www.x-rates.com/historical/?from=CAD&amount=1&date=2018-11-05。我想自动化这个过程,这样我每个月都能得到这些费率。这是我所得到的,我从这里迷路了:
'启动一个名为 SearchBot 的新子程序
Sub SearchBot()
'dimension (declare or set aside memory for) our variables
Dim objIE As InternetExplorer 'special object variable representing the IE browser
Dim aEle As HTMLLinkElement 'special object variable for an <a> (link) element
Dim y As Integer 'integer variable we'll use as a counter
Dim result As String 'string variable that will hold our result link
'initiating a new instance of Internet Explorer and asigning it to objIE
Set objIE = New InternetExplorer
'make IE browser visible (False would allow IE to run in the background)
objIE.Visible = True
'navigate IE to this web page (a pretty neat search engine really)
objIE.navigate "https://www.x-rates.com/table/?from=CAD&amount=1"
任何帮助将不胜感激!
【问题讨论】:
标签: excel vba web-scraping automation