環境開啟/關閉
Path:/api/v1/browser/start
Method:POST
Content-Type:application/json
接口描述:用於啟動指定的環境,啟動成功後可以獲取瀏覽器 debug 接口用於執行 selenium 和 puppeteer 自動化腳本。
請求參數
參數名稱 | 類型 | 必傳 | 樣例串/默認值 | 說明 |
Session_ID | array | 是 | 373808cb37bd63f5f7d92415e736e85f,705cc4c139e69b729a2fd277f30e1863 | 環境ID |
isHeadless | boolean | 否 | true | true:默認瀏覽器器無頭模式 false:瀏覽器有頭模式 |
isWebDriverReadOnlyMode | boolean | 否 | true | 是否只讀模式,默認 true 只讀。(只讀模式不會保存 cookie 等數據) |
args | array | 否 | "args": ["--disable-extensions", "--blinksettings=imagesEnabled=false"] | 啟動參數 |
單個環境請求示例
{
"Session_ID": [
"373808cb37bd63f5f7d92415e736e85f"
],
"args": [
"--disable-extensions",
"--blink-settings=imagesEnabled=false"
]
}
多個環境請求示例
{
"Session_ID": [
"373808cb37bd63f5f7d92415e736e85f",
"705cc4c139e69b729a2fd277f30e1863"
],
"args": [
"--disable-extensions",
"--blink-settings=imagesEnabled=false",
"--interval-seconds=3"
]
}
--disable-extensions 禁用插件
--blink-settings=imagesEnabled=false 禁止加載圖片
--interval-seconds 啟動各瀏覽器間隔時間(秒)
執行成功返回
{
"message": "Success",
"code": 0,
"data": {
"listid": [{
"Session_Name": "商用業務環境一",
"Session_ID": "373808cb37bd63f5f7d92415e736e85f",
"Group_Name": "default",
"Actived_script_id": "O73808cb37bd63f5f7d92415e736e999",
"Actiived_script_name": "這是一個腳本例子",
"Actiived_script_encode": "true",
"Weblogin_Account_Count": "4",
"Weblogin_Account_name": "aaa@163.com, aaa1@163.com, aaa2@163.com, aaa3@163.com",
"Plugins_Count": "4",
"Plugin_Id": "jjbnhpnlakcdgfnnldamfeinfmahhdlm,jjbnhpnlakcdgfnnldamfeinfmahhdlm,jjbnhpnlakcdgfnnldamfeinfmahhdlm,jjbnhpnlakcdgfnnldamfeinfmahhdlm",
"template_id": "123456",
"template_name": "抖音國際版",
"browser_Path": "D:\\mbbrowser\\Chromium_x64\\chromium.exe",
"browser_CDP_Port": 46973,
"MBData_Path": "C:\\MBDATA\xxxxxxxxxx\xxxxxxxxxx\xxxxxxxxxxx",
"Public_ip": "8.208.80.219",
"Internel_ip": "192.168.225.69",
"isDynamicIp": false,
"StartPage": "about:blank",
"proxyType": "socks5",
"proxy_ip": "127.0.0.1",
"proxy_port": "1080",
"isHeadless": "true",
"webdriver": "C:\\Users\\Administrator\\houniao\\Driver\\100\\chromedriver.exe", //根據當前打開環境的內核返回對應內核 webdriver 驅動路徑
"status": 0
}],
"total": 1
}
}