I tried every thing, XPATH, NAME, TAG_NAME, CSS_SELECTOR but it allways returns me this error :
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id='vote']/div[2]/div/form"}
Here is my code :
time.sleep(4)
form = navi.find_element(By.XPATH, "//*[@id='vote']/div[2]/div/form").click()
Here is the html code of the webpage :
<form action="https://www.serveursminecraft.org/serveur/" method="post">
<input type="hidden" name="id" id="id" value="2184">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" style="text-align: center;">Confirmation du vote pour Chocolia - Farm2Win - Lots IRL</h4>
</div>
<div class="modal-body">
<p style="font-size: 18px; text-align: center;"><span class="label label-info">Vous pouvez voter seulement 1 fois toutes les <b>24 heures</b>.</span></p>
<p style="font-size: 18px;">Vous êtes sur le point de voter pour Chocolia - Farm2Win - Lots IRL, êtes vous sur ?</p><br>
<div style="width: 300px; margin: 0 auto 1em auto;">
<div class="g-recaptcha" data-sitekey="6LegdhkUAAAAAJG95xpN69eylHs3bT4wRikdDQzH"></div>
</div>
</div>
<div class="modal-footer" style="text-align: center;">
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
<input type="submit" class="btn btn-success" value="Confirmer le vote"><br><br>
</div>
</form>
I want to select this line of code :
<input type="submit" class="btn btn-success" value="Confirmer le vote">
Here is a part of my python code :
WebDriverWait(navi,10).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[name^='a'[src^='https://www.google.com/recaptcha/api2/anchor?']")))
WebDriverWait(navi,10).until(EC.element_to_be_clickable((By.XPATH,"//span[@id='recaptcha-anchor']"))).click()
time.sleep(4)
navi.find_element(By.XPATH, "//*[@id='vote']/div[2]/div/form").click()
Can you help me?