I am trying to set the request header in selenium. For one or another reason, I am not able to find how to set such a header.
If I read correctly, this is not possible and I would need an extension in Chrome to set the request header: setting request headers in selenium
Is this answer still up to date? And are there other ways to implement a header in a get request using selenium?
I am using node js and selenium to build a web scraper.
Thanks in advance.
CodePudding user response:
Selenium does not support as of today, setting headers. It is not generally something a user does.
You can also try Mechanize. It's really old, and I am not sure if it has Python3 support -- but you can set the headers. A long time ago I used it for web-scraping.
However, you might get away by using good ol' requests and something like BeautifulSoup.
