My goal is to log into a page (https://www.icribis.com/it/) by entering my email address and password. The first step is to disable cookies, the second is to click on the button "ACCEDI" at the top right. At this point I have to enter my email and password and click on the button "Accedi" button. I miss this last part. This is my partial code:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
url = 'https://www.icribis.com/it/'
driver = webdriver.Chrome()
wait = WebDriverWait(driver, 20)
driver.get(url)
time.sleep(2)
# Disable cookies
driver.execute_script('return document.querySelector("#usercentrics-root").shadowRoot.querySelector("#uc-center-container > div:nth-child(2) div > button:nth-child(3)")').click()
time.sleep(2)
# Click the button "ACCEDI"
driver.execute_script('return document.querySelector("body > section.menu > div.row.show-for-xlarge-up > div.large-10.medium-6.small-12.columns > div.large-12.medium-12.small-12.columns.text-right.menuTop > ul > li.openClick.text-left > a")').click()
time.sleep(2)
# Enter your email and password and click the button "Accedi"
# ...
driver.close()
I would like to solve through the use of XPath, as their writing seems simpler and more compact to me, but how they work is still not very clear to me.
How can I finish my script?