Reputation: 85
When using Selenium Wire with Chrome, the browser is falling back to HTTP/2 on HTTP/3 enabled websites.
Why is this the case?
I am doing lots of various tests which is why I am specifying a random profile each time to avoid any pollution/cross contamination.
This problem does not occur with standard Selenium. (uncommenting 'webdriver' import and replacing 'wire_webdriver' with 'webdriver')
import os
import uuid
from seleniumwire import webdriver as wire_webdriver
# from selenium import webdriver
chrome_data_dir = f'chrome_data_dir/{str(uuid.uuid4())}'
os.makedirs(chrome_data_dir)
options = wire_webdriver.ChromeOptions()
options.add_argument(f'--user-data-dir={chrome_data_dir}')
driver = wire_webdriver.Chrome(options=options)
driver.get('https://cloudflare-quic.com/')
os.system('rm -rf chrome_data_dir/*')
I am using multiple sites to confirm Quic is not enabled:
When using my normal Chrome profile I use for everyday browsing all three come back saying Quic is enabled.
As a side note, when using standard selenium (where HTTP3/QUIC works), I can disabled quic by adding:
options.add_argument('disable-quic')
I can't find 'disable-quic' option documented anywhere, and when I navigate to 'chrome://flags' in the running selenium instance as configured above. 'enable-quic' option is set to defualt.
Upvotes: 0
Views: 177