Issue
I was trying to open stackoverflow and search for a query and then click the search button. almost everything went fine except I was not able to click submit button
I encountered error
WebDriverException: unknown error: Element ... is not clickable at point (608, 31). Other element would receive the click: (Session info: chrome=60.0.3112.101) (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86)
browser=webdriver.Chrome()
browser.get("https://stackoverflow.com/questions/19035186/how-to-select-element-with-selenium-python-xpath")
z=browser.find_element_by_css_selector(".f-input.js-search-field")#use .for class and replace space with .
z.send_keys("geckodriver not working")
submi=browser.find_element_by_css_selector(".svg-icon.iconSearch")
submi.click()
Solution
<button type="submit" class="btn js-search-submit">
<svg role="icon" class="svg-icon iconSearch" width="18" height="18" viewBox="0 0 18 18">
<path d="..."></path>
</svg>
</button>
You are trying to click on the svg
. That icon is not clickable, but the button is.
So change the button selector to .btn.js-search-submit
will work.
Answered By - xmcp
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.