Products
GG网络技术分享 2025-11-14 00:39 3
python
from selenium import webdriver
driver = webdriver.Chrome # 默认寻找周围变量PATH中chrome或chromium

python
driver.get
python
from selenium.webdriver.common.by import By
elem = driver.find_element_by_name
python
driver.get_cookies # 获取全部Cookies
driver.add_cookie # 添加Cookie
driver.delete_cookie # 删除指定Cookie
driver.delete_all_cookies # 删除全部Cookie
python
driver.execute_script")
python
driver.save_screenshot
python
options = webdriver.ChromeOptions
options.add_argument
driver = webdriver.Chrome
driver.execute_script;")
python
from selenium.common.exceptions import NoSuchElementException
try:
elem = driver.find_element_by_name
except NoSuchElementException as e:
print
python
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
elem = WebDriverWait.until))
python
driver.switch_to.window
谷歌ChromeDriver是一种与浏览器无关的浏览器自动化工具,允许你在程序控制下与Chrome浏览器传信。
Neng通过以下命令安装:
bash
pip install chromedriver
请注意,
Demand feedback