Create a function called descriptions
that takes in parameters base_url
and endings
and returns a dictionary with each ending as keys and their description as values. For this question, get a soup from each URL with an ending from endings
, get the first div tag
with class = 'body wysiwyg-content'
, and then extract the text from the first paragraph. That text will be the description for the dictionary value. For example, as of 2021, descriptions('https://www.si.umich.edu/programs/courses/', ['106', '206', '330'])
should return {'106': 'Introduction to programming with a focus on applications in informatics. Covers the fundamental elements of a modern programming language and how to access data on the internet. Explores how humans and technology complement one another, including techniques used to coordinate groups of people working together on software development.', '206': 'Students develop their core programming and software development skills, to build competency and literacy in important areas that includes basic data structures, debugging and testing, using distributed code repositories, pattern matching, and programmatic gathering and processing of data. Applications in assignments and labs are oriented around data manipulation.', '330': "Data analysis is crucial to application evaluation, as well as understanding users' information needs. When the data required are numerous we need an automated way to gather, parse, and summarize the data. In this course, you will learn to use Python and its modules to accomplish these tasks."}
.