Answer the question
In order to leave comments, you need to log in
How to change encoding in parsing?
I have this code:
import requests
from bs4 import BeautifulSoup
pastebin = 'https://pastebin.com/zCM6M9MY'
headers = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/78.0.4093.186"}
full_page = requests.get(google_dz, headers=headers)
soup = BeautifulSoup(full_page.content, 'html.parser', from_encoding='UTF-8')
convert = soup.findAll("div", {"class": "de1"})
print(convert[0].text)
Answer the question
In order to leave comments, you need to log in
You didn't specify a variable
full_page = requests.get(google_dz, headers=headers)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question