I got an html content received through python requests connection, but when i try to decode it by content.decode('utf-8')
I recieve UnicodeDecodeError.
The web page (https://www.etoro.com/sapi/trade-real/instruments) uses CloudFlare protection so I had to include headers to access via requests and it should return a json file (see in the link above).
url = 'https://www.etoro.com/sapi/trade-real/instruments'
headers = {...}
symbols = requests.get(url, headers=headers).content
symbols = symbols.decode("utf-8")
Now, I can read in the headers 'Accept-Encoding': 'gzip, deflate, br, zstd'
, anyway I can’t even decode the received content from b'...'
, I tried ‘utf-8’ and ‘latin-1’ decoding.
The received content:
“b’x13xffx15x00xc4>[xdaxdfxb9x9c:xcaxcc`xaax0cxc6xc9nx0cxb3xacx0b%xa4x87x91#$xbe$oxdfxf1xf1sxafxc2xb4xc6xd5tx9e5xf7xee^1x19xe5wx04pxefx92v/)!IB#Fxc6 ……”
Sorry for bad english or bad request. Please don’t downvote, I really need it. <3