Need help with task

https://www.codecademy.com/paths/data-science/tracks/dscp-data-acquisition/modules/dscp-web-scraping/projects/chocolate-scraping-with-beautiful-soup

task 3 states to use the response you got from your webpage as the document as your content. However, I did not receive a repsonse, so unsure what to put as my content.

The webpage code is
webpage = requests.get(“https://content.codecademy.com/courses/beautifulsoup/cacao/index.html”)

The hint for task 3 says

soup = BeautifulSoup(your_document, "your_parser")
`( `your_document` should be the `.content` of the webpage response you got from the last step.)``

Hi,
It’s probably a little less complicated than you think.

webpage holds an object as a result of the request.get(…)
One of its properties is content - which is the bit we need for BeautifulSoup.

i.e.
‘your_document’ just needs replacing with;
webpage.content

Hope that helps

Thank you for your answer if really helped

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.