Hello,
I have a working code which code is writing Class data in Excel.
This code is very good and works but but I see the Class data.
I'd like to modfy it (with ID). I'd like to Excel don't write the ID's data. I'd like only the ID.
For example source code:
<div id=aa_bb_qwer>
<div id=aa_bb_asdf>
<div id=aa_bb_yxcv>
I'd like to search every ID which starting aa_bb and take it to Excel.
For example: A1 cella = aa_bb_qwer, A2 cella = aa_bb_asdf, A3 cella = aa_bb_yxcv.
How can I do this?
Thanks for helping!
I have a working code which code is writing Class data in Excel.
VBA Code:
Sub test()
Dim WPage As Object, myUrl As String
Set WPage = CreateObject("Selenium.CHRomedriver")
Sheets("Sheet_1").Select
myUrl = "https://www.myurl.com"
WPage.Get myUrl
WPage.Wait 500
Set divs = WPage.FindElementsByClass("xxx")
For i = 1 To divs.Count
Range("A1").Offset(i).Value = divs(i).Text
Next
WPage.Quit
Set WPage = Nothing
End Sub
This code is very good and works but but I see the Class data.
I'd like to modfy it (with ID). I'd like to Excel don't write the ID's data. I'd like only the ID.
For example source code:
<div id=aa_bb_qwer>
<div id=aa_bb_asdf>
<div id=aa_bb_yxcv>
I'd like to search every ID which starting aa_bb and take it to Excel.
For example: A1 cella = aa_bb_qwer, A2 cella = aa_bb_asdf, A3 cella = aa_bb_yxcv.
How can I do this?
Thanks for helping!