I am using Selenium and Selenium-wire in Python. To amend headers in the webdriver, do we use request_intercept in Selenium-wire and ChromeOptions in Selenium?
Example to change refers
Selenium-wire
from seleniumwire import webdriver
driver = webdriver.Chrome()
def intercept(req):
del request.headers['Refers']
request.headers['Refers']='https://www.google.com/'
driver.request_interceptor= intercept
driver.get('URL')
Selenium
from selenium import webdriver
opt = webdriver.ChromeOptions()
r='https://www.google.com/'
opt.add_argument(f'refers={r}')
driver = webdriver.Chrome(options=opt)