一、nodeJS教程
下载地址:http://nodejs.cn/download/
安装教程:https://blog.csdn.net/qq_48485223/article/details/122709354
二、安装selenium-grid并运行
下载地址:http://selenium-release.storage.googleapis.com/index.html
参考文章:https://www.cnblogs.com/hls-code/p/15761437.html
三、yutu-tools安装及使用教程
使用文档:https://github.com/t880216t/yutu-tools
其中,需要注意的是config.json的修改:
1."syncBrowsers": [
{
"id": "2",
"displayName": "chrome",
"browserName": "chrome",
"version": "",
"httpProxy": "",
"screenSize": "1024x768x24",
"binary": ".\\QQBrowser.exe"
}]
2.同步浏览器如果是国产浏览器的话,往往需要写上对应的exe执行文件路径,地址格式应该是作为node节点的selenium-grid.jar包的相对路径地址
3.需要以哪种浏览器作为同步浏览器,应该是需要把selenium-grid,jar包和对应版本的浏览器驱动放在同一目录下,使用类似
java -jar selenium-server-standalone-3.9.1.jar -role node -port 7777 -hub http://127.0.0.1:4444/grid/register/ -maxSession 5 -browser browserName=chrome,seleniumProtocol=WebDriver,maxInstances=5,platform=WINDOWS,version=108.0的命令将作为node节点向selenium-grid hub节点注册,同时更改yutu下的config.json文件即可.
![](https://i-blog.csdnimg.cn/blog_migrate/c44165504e55e8e8565204fcc3b09f0c.png)