To select a music artist and one of their albums for which Wikipedia has a web page with a track list using requests
and beautifulsoup
libraries in Python, you can follow these steps:
Choose a music artist and their album, for which Wikipedia has a web page with a track list. Let's use the example of the album "Thriller" by Michael Jackson.
Use the requests
library to send a GET request to the Wikipedia page for that album, and store the response in a variable:
main.py117 chars5 lines
beautifulsoup
library to parse the HTML content of the response, and extract the track list from the page:main.py216 chars6 lines
main.py51 chars3 lines
This will output the track list of the album "Thriller" by Michael Jackson, which is extracted from the Wikipedia page using Python.
gistlibby LogSnag