Answer the question
In order to leave comments, you need to log in
How to parse text with Content-Encoding: gzip?
Here is the soup function:
def get_content(html):
soup = BeautifulSoup(html, 'html.parser')
items = soup.findall('div', class='column')
for item in items:
info = {
'title': item.find('h1', class_='page__title title').get_text(),
'timedate': item.find('span', class='date-display-single').get_text(),
'textstat': item.find('div', class='field-item even').get_text(),
}
news.append(info)
return news
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question