2
Python web scraping and importing modules
Deacon_Cronin (42)

Hi, I have been wanting to try web scraping with Python and most of the guides I find require two modules called "beautiful soup" and "requests" and I am not sure how to import these modules. Simply using the import command does not work. I can find requests on the import browser (on this website, not sure if it's the right one: https://2.python-requests.org/en/master/) but I cannot find beautiful soup on the browser or using the import command. Any help is appreciated!

You are viewing a single comment. View All
2
heyitsmarcus (280)

Hey @Deacon_Cronin,

I found beautiful soup in the Package manager in Python repls. Search for beautifulsoup4 which is the official package name. And requests is also in there under just "requests".

The description for beautifulsoup4 is "Screen-scraping library" and has a package homepage which is https://www.crummy.com/software/BeautifulSoup/

The description for requests is "Python HTTP for Humans." and has a package homepage which is https://2.python-requests.org/en/master/

1
Deacon_Cronin (42)

@heyitsmarcus Thank you very much for the response! I suppose I'm just blind and unable to find things. Thank you! Edit: Actually I'm still having some problems. Importing requests is fine, but I can't find the actual name to import for beautifulsoup. I tried beautifulsoup4 but it doesn't work.

2
heyitsmarcus (280)

@Deacon_Cronin No worries at all! If I helped you find your answer, please consider upvoting my answer and choosing it as the accepted answer to close this question. Cheers!

1
Deacon_Cronin (42)

@heyitsmarcus I will, but I'm actually still having some problems with actually importing the module. See the edit I made.

2
heyitsmarcus (280)

@Deacon_Cronin No problem, Deacon. I made a little repl for you with some simple BeautifulSoup code. https://repl.it/@heyitsmarcus/BeautifulSoup-test

I hope that helps some!

2
heyitsmarcus (280)

@heyitsmarcus That package homepage that I referenced in my original comment has documentation for BeautifulSoup that will really help! Here is a link directly to it for convenience: https://www.crummy.com/software/BeautifulSoup/bs4/doc/

0
Deacon_Cronin (42)

@heyitsmarcus My mistake! I missed the 'from bs4' Thank you for your help!

2