1
我想編寫代碼以通過ElementID(使用selenium和firefox)在VBA中從網站獲取數據,但它不起作用。使用Selenium-VBA從網站獲取數據
Public Sub seleniumtutorial()
Dim bot As New WebDriver
Dim i As Integer
Dim vrange As Range
Set vrange = Range("B1")
i = 1
Do While Len(vrange.Offset(i, 3).Value) > 0
bot.Start "firefox", "www.*****" & "-v" & vrange.Offset(i, 3).Value & "-en"
bot.Get "/"
Application.Wait (Now + TimeValue("0:00:3"))
vrange.Offset(i, 2).Value = bot.FindElementById("stats-container").FindElementsByClass("text-primary").getText()
i = i + 1
Loop
End Sub
任何人都可以幫助我嗎?