Issue
I'm trying to click on button that contains this code :
<div style="text-align:center" id="plus_res">
<img src="https://www.tunlancer.com/theme/images/plus_resv2.png" align="plus d'elements" title="plus d'elements" style="cursor:pointer" onclick="plus_resultat()">
</div>
i've tried :
image = driver.find_element_by_xpath("//img[contains(@src,'https://www.tunlancer.com/theme/images/plus_resv2.png')]")
driver.execute_script("arguments[0].click();", image)
driver.find_element_by_id('plus_res').click()
driver.find_element_by_xpath('//*[@id="plus_res"]/img').click()
But it's showing the NoSuchElementException . How can i fix it please?
Solution
Possibly you have to add delay.
Something like this should work :
time.sleep(5)
driver.find_element_by_css_selector('img[src="https://www.tunlancer.com/theme/images/plus_resv2.png"]').click()
Answered By - kisa lisa
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.