1. 程式人生 > >selenium 添加瀏覽器配置

selenium 添加瀏覽器配置

dir 故障 .com 添加 故障排除 www pda www. gpo

#-*-coding:utf-8-*-
from selenium import webdriver
from time import sleep

#火狐找到配置文件路徑:幫助>故障排除信息>配置文件夾>顯示文件夾
#應用場景,主要是做免登錄操作
profileDir = "C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\yn80ouvt.default"
profile = webdriver.FirefoxProfile(profileDir)
driver = webdriver.Firefox(profile)

# url = "https://www.baidu.com/"
url = "https://www.cnblogs.com/"
driver.get(url)

sleep(5)
driver.quit()

selenium 添加瀏覽器配置