SQUIDD
Well-known Member
- Joined
- Jan 2, 2009
- Messages
- 2,126
- Office Version
- 2019
- 2016
- Platform
- Windows
Hi
So my current code is very slow. I know the reason it is slow. But i just dont know how to go about changing it up.
I believe it is because i am parsing the browser for each and every element.
Is there a way i can copy the table and output it in a sheet quicker?
Thanks
Dave
So my current code is very slow. I know the reason it is slow. But i just dont know how to go about changing it up.
I believe it is because i am parsing the browser for each and every element.
Is there a way i can copy the table and output it in a sheet quicker?
Thanks
Dave
VBA Code:
Sub GET_DOGS()
Set mybrowser = New Selenium.ChromeDriver
mybrowser.AddArgument "--headless"
mybrowser.Get "https://greyhoundbet.racingpost.com/#search-dog/dog_id=556694"
ROW_COUNT = mybrowser.FindElementById("sortableTable").FindElementsByTag("tr").Count
For b = 2 To ROW_COUNT
For a = 1 To 16
Cells(b, a) = mybrowser.FindElementByXPath("/html/body/div[3]/div[2]/div[2]/div[2]/div[2]/div[1]/div/div/table[2]/tbody/tr[" & b & "]/td[" & a & "]").Text
Next a
Next b
mybrowser.Quit
End Sub