from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# 模拟鼠标操作
driver = webdriver.Chrome()
driver.get("http://www.baidu.com")

element1 = driver.find_element_by_css_selector("#id")
ActionChains(driver).context_click(element1).perform()
ActionChains(driver).send

3be78e6e6c559f9cb7f74e978c5b1759299092c1
<mask token>

<mask token>
driver.get('http://www.baidu.com')
<mask token>
ActionChains(driver).context_click(element1).perform()
ActionChains(driver).send

<mask token>
driver = webdriver.Chrome()
driver.get('http://www.baidu.com')
element1 = driver.find_element_by_css_selector('#id')
ActionChains(driver).context_click(element1).perform()
ActionChains(driver).send

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome()
driver.get('http://www.baidu.com')
element1 = driver.find_element_by_css_selector('#id')
ActionChains(driver).context_click(element1).perform()
ActionChains(driver).send

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# 模拟鼠标操作
driver = webdriver.Chrome()
driver.get("http://www.baidu.com")

element1 = driver.find_element_by_css_selector("#id")
ActionChains(driver).context_click(element1).perform()
ActionChains(driver).send
