We use Python 3.6

go back Level: Intermediate (img: IM / score: 3) level Bite 49. Scrape Packt's html with BeautifulSoup

17 out of 18 users completed this Bite ...
Will you be Pythonista #18 to crack this Bite?
Average Bite difficulty 1-10 rating: 4.5
» Up for a challenge? 💪

In this Bite you will parse Packt's free learning ebook site extracting the html for the daily free ebook:
Packt's free learning resource

As this page is changing all the time (and to not hit their servers too much) we saved a copy of the html on our server and loaded it into CONTENT

Now the best part: meet your new best friend when dealing with HTML: BeautifulSoup, a module that makes dealing with html a breeze.

Get coding: complete get_book by making a Soup object and parsing out the relevant fields as defined in Book. Next populate and return this namedtuple.

Have fun and keep calm and code in Python!

Github login button