I am very new to Python, still trying to figure everything out.
While trying my hand at web-scraping I got into a problem:
The website requires a sign in and a pop-up shows up as soon as search results page shows up and sometimes while scrolling and looking at results. So I need to press escape and then hover over(or I can click it) the "Sign In" drop-down menu and click: "Sign in" in the drop down menu.
But right now, from an education point of view I wanted to move the mouse to the element using its XPath.
I did the following and it doesn't work.
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
chrome_path = r"C:\Users\------\Desktop\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get("URL of the webnsite I am scraping") #sorry had to remove the link :(
driver.maximize_window()
#code below this is not working
action = webdriver.ActionChains(driver)
action.move_to_element((By.XPATH, '//*[@id="user_sign_in"]'))
#Tried the ones below and they didn't work either
#driver.move_to_element(By.XPATH, '//*[@id="user_sign_in"]')
#login_menu = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="user_sign_in"]')))