Python Tutorial: Web Scraping with BeautifulSoup and Requests

///Python Tutorial: Web Scraping with BeautifulSoup and Requests

Python Tutorial: Web Scraping with BeautifulSoup and Requests

FavoriteLoadingAdd to favorites

In this Python Programming Tutorial, we will be learning how to scrape websites using the BeautifulSoup library. BeautifulSoup is an excellent tool for parsing HTML code and grabbing exactly the information you need. So whether you’re pulling down headlines from news sites, scores from sports websites, or prices from an online store… BeautifulSoup and Python will help you get this done quickly and easily. Let’s get started…

The code from this video can be found at:

Difference Between Parsers:
Python File Objects:
Python Strings:
Python Try/Except:
Python CSV Files:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –

#Python

source

By |2019-06-25T20:12:03+00:00June 25th, 2019|Python Video Tutorials|21 Comments

21 Comments

  1. Sam ha June 25, 2019 at 8:12 pm - Reply

    Great work as always. But how can you interact with the webpage to go-to the next page? I have tried selenium but it's pretty slow. Is it possible to use the request lib to click on the links? Thanks

  2. All Things Reddit June 25, 2019 at 8:12 pm - Reply

    This is great, thank you!

  3. llsniperll men June 25, 2019 at 8:12 pm - Reply

    Maybe this would help to understand everything about scraping https://websitescrapingtutorials.wordpress.com/2019/06/23/how-to-scrape-yelp/

  4. Lawrence Krukrubo June 25, 2019 at 8:12 pm - Reply

    This is just amazing, your knowledge, no your practical knowledge is amazing

  5. sYer Wang June 25, 2019 at 8:12 pm - Reply

    how to get the site need Login first,thanks alot

  6. story factory June 25, 2019 at 8:12 pm - Reply

    I want to scrap youtube video subtitles can u help me

  7. Shubham Bansal June 25, 2019 at 8:12 pm - Reply

    Corey a Big Bow from India….. really you are too amazing

  8. Patriotic Ghanaian June 25, 2019 at 8:12 pm - Reply

    Great tutorial as always. Just one issue though: I encountered an encoding error looking like this:
    UnicodeEncodeError: 'ascii' codec can't encode character u'u2013' in position 29: ordinal not in range(128)
    I solved that by using the encode(utf8) to encode the html text to utf-8 format like this:

    #For the headline
    headline = article.h2.a.text.encode('utf8')
    #For the summary
    summary = article.find('div', class_='entry-content').p.text.encode('utf8')

    The rest is the same! Keep up the good work man!

  9. Rohith P June 25, 2019 at 8:12 pm - Reply

    why can't we scrape complete amazon page without headers?

  10. Mazikeen June 25, 2019 at 8:12 pm - Reply

    I used requests and BeautifulSoup to write a python script, that allows you to scrape all historical data of a cryptocurrency by simply putting in the name of currency.
    https://github.com/gitFaisal/crypto_currency_scraper

  11. Tal Barak June 25, 2019 at 8:12 pm - Reply

    When trying this in Visual Studio Code, I got "no bs4 module could be found". So, I used "pip install bs4".

  12. aryan chauhan June 25, 2019 at 8:12 pm - Reply

    thanks, man through this I am able to scrap live cricket scores from cricbuzz.com

  13. Mani Srujan June 25, 2019 at 8:12 pm - Reply

    I have a doubt
    why does sometimes,the downloaded HTML file using requests look different from code in inspect elements ?

  14. lardosian June 25, 2019 at 8:12 pm - Reply

    Is this an alternative way of getting data as opposed to an API for example?

  15. Akshay Bhadange June 25, 2019 at 8:12 pm - Reply

    thanks sir
    very helpful

  16. Nick Gibra June 25, 2019 at 8:12 pm - Reply

    Thank you very much for this tutorial. Your explanations were better than some courses and books that I tried. Thank you again.

  17. Jester j June 25, 2019 at 8:12 pm - Reply

    Thank you so much. You answered several of my questions and literally saved my ‘avoiding boredom’ project

  18. Harshit Khandelwal June 25, 2019 at 8:12 pm - Reply

    East and West, Corey Schafer is the Best!

  19. Virtual Reality June 25, 2019 at 8:12 pm - Reply

    Thanks man.

  20. Carlos Matos Fanpage June 25, 2019 at 8:12 pm - Reply

    Is this legal

  21. Mg June 25, 2019 at 8:12 pm - Reply

    nice

Leave A Comment

*