0

I want to fetch a response body as string in selenium-wire which I will eventually parse as JSON.

response.body in selenium-wire gives bytes string. I tried decoding it as response.body.decode('utf-8') but this gives decoding error.

Can someone help me with this? I am fine with both solutions:

  1. Either a way to decode the bytes string as normal string
  2. A way to get response body as normal string in the first place
hp2505
  • 3
  • 1
  • 3

1 Answers1

0

I figured out a way to do this (not an ideal approach) While making the selenium webdriver object, you can pass a parameter options in which you can tell it explicitly to give decoded request and response objects and not as bytes.

hp2505
  • 3
  • 1
  • 3