WebDriver.jl
WebDriver.jl copied to clipboard
Is there any function to set requests headers such as "User-Agent" as in python do?
You know, HTTP requests always with some headers, for example:
Alt-Used | www.google.com
Connection | keep-alive
Content-Length | 0
Cookie | 1P_JAR=2022-06-06-08; AEC=AakniGPg9f0jElmQFThLWYaQOi4MPjtxo3GDqN858tVyQ5Levest4-v_uVg; NID=511=QnbgBgSEcnT2maCyZWrdzFYJSNLf9VJFAwfgvRL2JcgAEMtWi-MrJ6V90Io95_WheDIBjUnBPaF0ouKASOKaPfLYYvePjCnGn3c27_upSWIA8OlrBE6k4FkcRUyqOEZJCGpYB_J_pj13ZYWFuuXKEF1IEEi-35WrXdZpX01_Z3s; ANID=AHWqTUl_RHy8pJhn4lkhbmY7mpRMPUvdQHmo8MKeoJkBI5cQgZ0bePgqyehtLkk9; OTZ=6529362_24_24__24_; DV=k-pXlNQcK0srMMNiN6YW-gZEx6OAExjeCHNonvMxfBQtAgA
Host | www.google.com
Origin | https://www.google.com
Referer | https://www.google.com/
Sec-Fetch-Dest | empty
Sec-Fetch-Mode | no-cors
Sec-Fetch-Site | same-origin
TE | trailers
User-Agent | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0
I read the document, but find nothing about how to set the headers. Google result is for python:
chromedriver = 'C:/tests/chromedriver.exe'
options = webdriver.ChromeOptions()
options.add_argument('--user-agent = Googlebot/2.1 (+http://www.google.com/bot.html)')
driver = webdriver.Chrome(executable_path = chromedriver, chrome_options = options)