Selenium设置浏览器的启动语言
2021-02-10 10:16
阅读:381
标签:sel ons zh-cn net profile argument options sele web
python3.7
Chrome:
# 修改lang=zh-CN即可更改语言, 可在 https://blog.csdn.net/Sam_ONE/article/details/102571595 下寻找对应的
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(‘lang=zh-CN‘)
driver = webdriver.Chrome(options=chrome_options)
Firefox:
# FireFox_Configure_path 为火狐浏览器不同语言下的配置文件,firefox_path为火狐浏览器geckodriver.exe的所在目录
ffprofile = webdriver.FirefoxProfile("%s"%FireFox_Configure_path )
driver = webdriver.Firefox(executable_path=firefox_path, firefox_profile=ffprofile)
Selenium设置浏览器的启动语言
标签:sel ons zh-cn net profile argument options sele web
原文地址:https://www.cnblogs.com/TestDeveloper/p/12743552.html
评论
亲,登录后才可以留言!