别对我太客气了,因为我是新手。我已经创建了几个用于提取搜索结果的宏:Sec全文搜索:http://searchwww.sec.gov/EDGARFSClient/jsp/EDGAR_MainAccess.jsp
现在,我的数据已全部清理并设置在不同的列中,我需要根据结果创建一个查询。在B列中,我有一个公司名称列表,我想引用"B“列中的每个单元格,并在http://www.marketwatch.com/tools/quotes/lookup.asp?siteID=mktw&Lookup=options+media&Country=us&Type=All上查询与公司名称相关的股票代码。这会对我有所帮助,因为最终我会想要执行多个查询,拉取有关股票结构、收入等的信息。如果您愿意回答这个问题,我将不胜感激。
发布于 2013-04-08 07:50:01
试试下面的代码。
Sub website()
Dim doc As HTMLDocument
Dim htmTable As HTMLTable
Set doc = New HTMLDocument
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "http://www.marketwatch.com/investing/stock/BAC"
.send
Do: DoEvents: Loop Until .readyState = 4
doc.body.innerHTML = .responseText
.abort
End With
Set htmTable = doc.getElementsByClassName("companyname")(0)
If Not htmTable Is Nothing Then
MsgBox htmTable.innerText
End If
Set htmTable = doc.getElementsByClassName("lastprice")(0)
If Not htmTable Is Nothing Then
MsgBox htmTable.innerText
End If
End Subhttps://stackoverflow.com/questions/15868188
复制相似问题