我正在尝试限制网络吞吐量,但我无法克服这个错误。
popUntil
我的输出是:
from selenium import webdriver
from selenium.webdriver.remote.command import Command
mobile_emulation = {"deviceName": "Nexus 5"}
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
driver = webdriver.Remote(
command_executor="http://127.0.0.1:4444/wd/hub",
desired_capabilities=chrome_options.to_capabilities(),
)
driver.execute(
Command.SET_NETWORK_CONNECTION,
{
"offline": False,
"latency": 5,
"download_throughput": 500 * 1024,
"upload_throughput": 500 * 1024,
},
)
Selenium 版本 4.0.0b1,Python 3.7.7。
我已经阅读了 Network throttling with chrome and selenium 和 error "network connection must be enabled" while setting networkConnection with ChromeDriver,但我仍然无法弄清楚。