📅  最后修改于: 2022-03-11 14:56:04.440000             🧑  作者: Mango
# initiate the driver with undetetcted_chromedriver
import undetected_chromedriver.v2 as uc
driver = uc.Chrome()
# operate the driver as you would with selenium
driver.get('https://my-url.com')
# Example use of selenium imports to be used with the driver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
try:
driver.find_element(By.XPATH, '//*[@id="my-id"]').click()
except NoSuchElementException:
print("No Such Element Exception")