美文网首页
python+selenium远程控制浏览器

python+selenium远程控制浏览器

作者: Lydia1991 | 来源:发表于2020-07-13 11:22 被阅读0次

1、首先下载需要的jar包
https://www.seleniumhq.org/download/

2、指定端口的方式启动下载好的jar包,不指定默认是4444端口(此处我指定的是4446端口)

java -jar selenium-server-standalone-3.141.59.jar -port 4446

3、控制方执行以下代码:

from selenium import webdriver

driver = webdriver.Remote(command_executor="http://192.168.206.XXX:4446/wd/hub",
                          desired_capabilities={'platform': 'ANY',
                                                'browserName': 'chrome',
                                                'version': '',
                                                'javascriptEnabled': Tru})

相关文章

网友评论

      本文标题:python+selenium远程控制浏览器

      本文链接:https://www.haomeiwen.com/subject/pjcacktx.html