L
L
LordOftheCode2021-11-10 12:36:01
Python
LordOftheCode, 2021-11-10 12:36:01

How to convert this code under session.requests() python?

Code to be converted:

import urllib.request

resp = urllib.request.urlopen(url)
respData = resp.read()
print(respData.decode())

you need to translate this code into the requests session ( s = requests.session() )
and also how to decode the received html in this code,
otherwise if you just display the text received from the request, it gives this
vAhJL0U.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question