I'm migrating an old spreadsheet that I use to collect/send information on a website, originally made in IE, I'm migrating to Selenium (Chrome).
I need help with this part. I need to get all tags: "tr" in a table id: "tablename":
In IE it works perfectly:
I need help to migrate this code for Selenium (VBA), i tried this, but it doesn't work.
Appear a error code 438: "Object Doesn’t Support This Property or Method" in the first line into the for :
"Sheets("Sheet1").Range("A" & y).Value = ele.Children(0).textContent"
Could anyone help me please?
I need help with this part. I need to get all tags: "tr" in a table id: "tablename":
In IE it works perfectly:
VBA Code:
Sub InternetExplore()
Dim objIE As InternetExplorer
Dim ele As Object
Dim y As Integer
objIE.Visible = True
objIE.navigate "URL"
Do While objIE.Busy = True Or objIE.readyState <> 4: DoEvents: Loop
y = 1
For Each ele In objIE.document.getElementById("tablename").getElementsByTagName("tr")
Sheets("Sheet1").Range("A" & y).Value = ele.Children(0).textContent
Sheets("Sheet1").Range("B" & y).Value = ele.Children(1).textContent
y = y + 1
Next
End Sub
I need help to migrate this code for Selenium (VBA), i tried this, but it doesn't work.
Appear a error code 438: "Object Doesn’t Support This Property or Method" in the first line into the for :
"Sheets("Sheet1").Range("A" & y).Value = ele.Children(0).textContent"
VBA Code:
Sub Chrome()
Dim ele As Object
Dim y As Integer
Set objIE = New Selenium.ChromeDriver
objIE.Start
objIE.Get "URL"
y = 1
For Each ele In objIE.FindElementById("tablename").FindElementsByTag("tr")
Sheets("Sheet1").Range("A" & y).Value = ele.Children(0).textContent
Sheets("Sheet1").Range("B" & y).Value = ele.Children(1).textContent
y = y + 1
Next
End Sub
Could anyone help me please?