I am having not luck getting a button click on a webpage.
in python coding using selenium on chrome browser.
I have found the xpath in chrome inspect.
chrome inspect xpath: NOTE Which is a looks to be a dynamic path after exportbutton-xxxx-btnInnerEl.
//*[@id="exportbutton-1102-btnInnerEl"]
I have tried 10 different xpath formats and not getting any closer to getting button selected to run report on website. My test case is just to get button pressed on this page to export some date.
Here is buttonn element in html
<span id="exportbutton-1102-btnInnerEl" class="x-btn-inner" style="height: 23px; line-height: 23px;">Export Tickets</span>
Run Error output from python in order:
submit_button = driver.find_elements_by_xpath('//*[contains(@id,’exportbutton’)]')
run errors in python
submit_button = driver.find_elements_by_xpath('//*[contains(@id,’exportbutton’)]')
return self.find_elements(by=By.XPATH, value=xpath) 'value': value})['value']
self.error_handler.check_response(response)
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //*[contains(@id,’exportbutton’)] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//*[contains(@id,’exportbutton’)]' is not a valid XPath expression.
(Session info: chrome=67.0.3396.99)
(Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)
Thanks