WebScraping - How to copy data from page 2?

Silmar

New Member
Joined
Mar 20, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Boa noite a todos! Estou obtendo a tabela "1" do site que está no arquivo anexo, para isso estou utilizando o seguinte código VBA:

Sub WebScraping()

Dim urlSite As String
Dim tabela As QueryTable
Dim tabelaExistente As QueryTable

For Each tabelaExistente In Sheets("Dados").QueryTables
tabelaExistente.Delete
Next

Sheets("Dados").Cells.Delete shift:=xlUp

urlSite = "BLMR11 - BLUEMACAW RENDA + FOF: dividendos e cotação"

Set tabela = Sheets("Dados").QueryTables.Add("URL;" & urlSite, Sheets("Dados").Range("A1"))

tabela.WebSelectionType = xlSpecifiedTables
tabela.WebTables = "1"
tabela.WebFormatting = xlWebFormattingNone

tabela.Refresh

End Sub

O problema é que também preciso obter a "página 2" desta tabela e não faço ideia de como fazer isso. Alguém sabe como adaptar essa macro?

Muito obrigado a quem puder ajudar,
Silmar
 

Attachments

  • exemple.png
    exemple.png
    171.4 KB · Views: 10

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:

There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,223,445
Messages
6,172,176
Members
452,446
Latest member
walkman99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top