from selenium import webdrive
from selenium.webdriver.common.action_chains import ActionChains
import time
dr = webdriver.Chrome()
#访问百度首页
url= 'http://www.baidu.com'
print("denglu百度" )
dr.get(url)
ele= dr.find_element_by_xpath("//img[@src='http://www.baidu.com/img/bd_logo1.png']")
ActionChains(dr)._context_click(ele)
time.sleep(3)
dr.close()
dr.quit()
相似问题