0

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.

frankmurphy
  • 194
  • 1
  • 3
  • 13

1 Answers1

0

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.

wiz
  • 73
  • 7