hello good afternoon
I would like some help with this code, if possible, it enters the site and extracts data from just one table, how can I copy all the tables on the site?
I'm using the code below
I tried to use the code in the attached image ("/html/body/div[1]") to select them all, but I got an error
Sub ExtractTabs()
Set driver = New ChromeDriver
Dim dest As range
Set dest = range("A1")
driver.Get "https://www2.bmf.com.br/pages/portal/bmfbovespa/lumis/lum-tipo-de-participante-ptBR.asp"
Dim tabel As WebElement
Set tabel = driver.FindElementByXPath("/html/body/div[1]/div[2]/div/table[1]")
If tabel Is Nothing Then
MsgBox "element not found"
Else
tabel.AsTable.ToExcel dest
End If
driver.Quit
End Sub
I would like some help with this code, if possible, it enters the site and extracts data from just one table, how can I copy all the tables on the site?
I'm using the code below
I tried to use the code in the attached image ("/html/body/div[1]") to select them all, but I got an error
Sub ExtractTabs()
Set driver = New ChromeDriver
Dim dest As range
Set dest = range("A1")
driver.Get "https://www2.bmf.com.br/pages/portal/bmfbovespa/lumis/lum-tipo-de-participante-ptBR.asp"
Dim tabel As WebElement
Set tabel = driver.FindElementByXPath("/html/body/div[1]/div[2]/div/table[1]")
If tabel Is Nothing Then
MsgBox "element not found"
Else
tabel.AsTable.ToExcel dest
End If
driver.Quit
End Sub