code
#follow_order_information_page_driver.get("选择非企业员工").click() #element = follow_order_information_page_driver.get("选择非企业员工") #charome.execute_script("arguments[0].click();", element) #ele = follow_order_information_page_driver.get("选择非企业员工") #ActionChains(charome).move_to_element(ele).move_by_offset(5,5).click().perform()
code2
默认selenium的点击操作是点元素0,0点坐标,那么我们可以在元素x,y坐标上加5,让点击操作往里一点 from selenium.webdriver.common.action_chains import ActionChains ele = self.find_element(*loc) ActionChains(driver).move_to_element(ele).move_by_offset(5,5).click().perform()