I'm trying to gather the information on a website using Python 3.6 and Selenium, however, the page loads right away on Chrome(54.0.2840.87(64-bit)), it goes to the tab(Case Logs) for half second, then it changes to another tab(Alerts).
I tried to find it using 'find_element_by', clicking at certain point, finding the text on the tab(Case Logs). If I use 'find_element_by_xpath', I get 'Element is not clickable at point (488, 93). Other element would receive the click'.
Here is the code:
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.action_chains import ActionChains
#enter credentials
user = input('User: ')
password = input('Password: ')
case = input('Case: ')
#open the page
driver= webdriver.Chrome()
driver.maximize_window()
driver.get('.com')
#login
elem = driver.find_element_by_id("user")
elem.send_keys(user)
elem = driver.find_element_by_id("password")
elem.send_keys(password)
elem.send_keys(Keys.RETURN)
#Find Case
elem = driver.find_element_by_id("searchCaseIdHome")
elem.send_keys(case)
elem.send_keys(Keys.RETURN)
#Find Notes
elem = driver.find_element_by_xpath("//*[@id='ext-gen151']")
elem.click()
解决方案elem = driver.find_element_by_xpath("//*[@id='ext-gen151']")
elem.location_once_scrolled_into_view
elem.click()