Jump to content
Sign in to follow this  
Mindy McAdams

Suggestion for making the soup

Recommended Posts

This is a suggestion, not a question. In the final module of "Python for journalists," Winny has this line for making the soup:

soup = BeautifulSoup(page.content, 'html.parser')

It would be better to have this instead:

soup = BeautifulSoup(page.text, 'html.parser')

The difference between text and content (from the Requests library) is explained here: 

https://stackoverflow.com/questions/17011357/what-is-the-difference-between-content-and-text 

Great course! Very useful. 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

subscribe figure
×
×
  • Create New...