WebScrapping Tables Using Selenium With Google Chrome (VBA)
How to install Selenium?
Click the below link to know the steps.
https://learnexcelwithsujeet.blogspot.com/2021/05/steps-to-install-and-use-selenium-for.html
Example-1
Sub test()
Dim ch As Selenium.ChromeDriver
Dim ts As Selenium.WebElements
Set ch = New Selenium.ChromeDriver
ch.Start
ch.Get "https://www.indiatoday.in/education-today/gk-current-affairs/story/indian-states-with-highest-population-1358414-2018-10-08"
Set ts = ch.FindElementsByCss("table")
Debug.Print ts.Count
ts(1).AsTable.ToExcel ThisWorkbook.Sheets(1).Range("a1")
End Sub
Comments
Post a Comment