1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| from selenium import webdriver
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
web1 = webdriver.Chrome(ChromeDriverManager().install())
web1.get('https://reassurez-moi.fr/simulation-tarifaire-assurance-habitation?homeType=1')
#time.sleep(2)
topics_xpath = '//*[@id="home-comparator-base"]/div[2]/div/div[2]/div/form/div[1]/div[1]/div/div[1]/div[2]/div/div[2]/button'
WebDriverWait(web1, 2).until(expected_conditions.visibility_of_element_located((By.XPATH, topics_xpath)))
Rue_Adresse = "Rue de la Paix"
last = web1.find_element_by_xpath('//*[@id="home-comparator-base"]/div[2]/div/div[2]/div/form/div[3]/div[1]/div[2]/div/input')
last.send_keys(Rue_Adresse)
ast = web1.find_element_by_xpath('//*[@id="home-comparator-base"]/div[2]/div/div[2]/div/form/div[1]/div[1]/div/div[1]/div[2]/div/div[2]/button')
ast.click() |
Partager