We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi so i have the followinng code, i can change the user-agent jsut fine, but how to add additional header options ?
from selenium.webdriver import FirefoxOptions from helium import* useragent = "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0" options = FirefoxOptions() options.set_preference("general.useragent.override",useragent) s = start_firefox("https://www.instagram.com", headless=False, options=options,) time.sleep(15) kill_browser()
i want to add the following full headers.. How can I do that ? Thanks
headers = {"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", "Accept-Encoding" : "gzip, deflate, br", "Accept-Language" : "en-GB,en;q=0.5", "Connection" : "keep-alive", "Host" : "data.similarweb.com", "Sec-Fetch-Dest" : "document", "Sec-Fetch-Mode" : "navigate", "Sec-Fetch-Site" : "none", "Sec-Fetch-User" : "?1", "Upgrade-Insecure-Requests" : "1", "User-Agent" : "Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Firefox/103.0"}
The text was updated successfully, but these errors were encountered:
Why do you need to add headers like this? Are you trying to do API testing?
Sorry, something went wrong.
Hi thanks for the reply.
Some websites block if proper headers are not there. I am web scraping many retail websites.
I was web scraping just fine.. but could not open Nordstrom.
So that's why want to ask how to add custom headers to the script.
Nordstrom opens fine while regular browsing.. but not with helium/selenium
Thanks
No branches or pull requests
Hi so i have the followinng code, i can change the user-agent jsut fine, but how to add additional header options ?
i want to add the following full headers.. How can I do that ? Thanks
The text was updated successfully, but these errors were encountered: