我看到chromedriver发布了一个更新,它启用了所需功能的网络限制功能。我试过但它在任何配置上仍然使用相同的速度。请参阅以下代码:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
def test_youtube():
d = DesiredCapabilities.CHROME
d['networkConnectionEnabled'] = {'type': 'Wifi'}
driver = webdriver.Chrome(executable_path='path',desired_capabilities=d)
driver.get('http://www.youtube.com')
print driver.title
driver.save_screenshot('test.png')
driver.quit()