I have been having trouble on referring to a search box on a website through Selenium in VBA. The HTML code of the box is:
To send a character sequence within the desired element you can use either of the following Locator Strategies:
Using FindElementByCss
:
bot.FindElementByCss("input.form-control.input-sm[aria-controls='result_table']").SendKeys ("werresf")
Using FindElementByXPath
:
bot.FindElementByXPath("//input[@class='form-control input-sm' and @aria-controls='result_table']").SendKeys ("werresf")
You can find a couple of relevant discussions in: