admin管理员组

文章数量:1326140

cmd运行

chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\selenum\AutomationProfile"

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
 # -*- coding: utf-8 -*-
import random
import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait














chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")
chrome_driver = "C:/Users/MSI-CN/AppData/Local/Google/Chrome/Application/chromedriver.exe"
driver = webdriver.Chrome(chrome_driver, chrome_options=chrome_options)
print(driver.title)#目前网页的标题








browser = driver


url="这里输入要访问的目标网址"
browser.get(url)#括号里面输入要访问的网址




time.sleep(20)#暂停20s便于打开网页

本文标签: 爬虫器上操作seleniumpython