簡體   English   中英

使用Internet Explorer對象抓取信息?

[英]Using the Internet Explorer object to scrape information?

我試圖從網站上抓取一些信息。 我引用的鏈接是: https : //web.tmxmoney.com/quote.php?qm_symbol=WEED

我正在使用以下內容創建Internet Explorer對象:

Dim appIE As Object
Set appIE = CreateObject("internetexplorer.application")

Dim ticker As String
ticker = "BRB"

With appIE
    .Navigate "https://web.tmxmoney.com/quote.php?qm_symbol=" & ticker
    .Visible = False
End With

Do While appIE.Busy
Loop

然后,我嘗試使用以下內容獲取類的內容:

Set testing = appIE.document.getElementsByClassName("quote-name")(0).textContent
Debug.Print (testing)

但是,我收到錯誤: Type Mismatach 但是,以下代碼可以正常運行: appIE.document.getElementsByClassName("quote-name")

我想要的內容如下,可以在IE控制台中正常運行。

"
                    Brick Brewing Co. Limited
                    Exchange: TSX Exchange |
                                                        Jul 26, 2017, 2:46 PM EDT                                               "

有什么想法可能有問題嗎?

嘗試這些代碼行

測試= appIE.document.getElementsByClassName(“ quote-name”)(0).textContent

Debug.Print(測試)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM