''' //windows cd到chrome所在的文件夹下,再以debug模式启动 chrome.exe --remote-debugging-port=9527 --user-data-dir=“D:\pycharm\zdh_rxy" --remote-debugging-port远程控制接口 --user-data-dir为项目目录 ''' from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By import time import 观看 options = Options() options.add_experimental_option("debuggerAddress", "127.0.0.1:9527") chromedriver = "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe" s = Service(chromedriver) browser = webdriver.Chrome(service=s, options=options)
while(True):
(操作内容。。。)