Moment Hood
Moment Hood

Reputation: 29

VBA IE queryselector converting to Selenium

i need to convert my code from IE to Chrome with Selenium ive managed to log in to my server, now i have 3 actions left : With Internet Explorer i had this code to select an option from drop down list, then click a button to download and save IE popup :

ie.document.querySelector("[value='export_selected']").Selected = True

Set Go = ie.document.querySelector("[title='Run the selected action']")
Go.Click

Application.Wait (Now + TimeValue("00:00:03"))

Application.SendKeys "%{s}"

How will i write these lines to use with Selenium Chrome? Thank you for helping a noob! Contents : enter image description here

Upvotes: 0

Views: 827

Answers (1)

YasserKhalil
YasserKhalil

Reputation: 9568

Try using this line for selenium

bot.FindElementByCss("[value='export_selected']").Click

so instead of .querySelector use .FindElementByCss and use Click method.

Upvotes: 2

Related Questions