Hi all!
I'm writing vba using selenium and uses the chromedriver.
I know this will print each dropdown's label value from a webpage in a different cell in Sheet1 and it works:
How do I print each dropdown's element Class from a webpage in a different cell in a sheet?
Sometimes the beginning of an element is the same and the end is different. I can't figure out how to set values to a series of dropdowns where part of the element class changes. Right now I can only manipulate the first dropdown by using an xpath starts-with
So attempting to pivot, if I could know the exact class for each dropdown then I could target each dropdown and set their value. I don't want to manually inspect each dropdown on the page to get the class. If I have to do it manually, it defeats the purpose of automating.
If you have anyone has better ideas, I'm all ears. Thanks!!
I'm writing vba using selenium and uses the chromedriver.
I know this will print each dropdown's label value from a webpage in a different cell in Sheet1 and it works:
VBA Code:
Dim i As Long
i = 1
Set rvar2s = bot.FindElementsByXPath("//*[starts-with(@id,'pneumo')]")
For Each rvar2 In rvar2s
i = i + 1
Sheets("Sheet1").Cells(i, 2).Value = rvar2.Text
Next rvar2
How do I print each dropdown's element Class from a webpage in a different cell in a sheet?
Sometimes the beginning of an element is the same and the end is different. I can't figure out how to set values to a series of dropdowns where part of the element class changes. Right now I can only manipulate the first dropdown by using an xpath starts-with
So attempting to pivot, if I could know the exact class for each dropdown then I could target each dropdown and set their value. I don't want to manually inspect each dropdown on the page to get the class. If I have to do it manually, it defeats the purpose of automating.
If you have anyone has better ideas, I'm all ears. Thanks!!