0

With the requests library, you can do this to get the site content as bytes:

requests.get("https://httpbin.org/get").content

There is a specific reason why I am using selenium instead of the requests library to basically do a GET request.

This 4 year old answer uses requests instead of selenium, this 3 year old forum post doesn't have any answers, and this 13 year old question doesn't include getting the page source as bytes.

Is there a way to get the page source as bytes instead of a string?

1
  • While not nearly as active as StackOverflow, there is a StackExchange site dedicated to Software Quality Assurance that accepts all selenium related questions. Full disclosure, I am a moderator there, but even if I wasn't I would have suggested it. Commented Dec 7, 2024 at 0:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.