Code as a Liberal Art, Spring 2021

Unit 2, Exercise 3 homework

Due: Tuesday, March 23, 8pm

  1. Review the class notes for this week.
  2. Try a simpler scraping exercise.

    Find a website that has a search function, search for something, and use the browser inspector to examine the HTML results. For example, searching for "widgets" on Ebay.

    Copy/paste the URL into a Python program to make a request to get() that page, get its content, and create a BeautifulSoup object.

    Now, using Beautiful Soup, target the HTML element containing the list results. For each one, access 2-3 specific properties for each result, and simply print() them in some way. For example:

     Widget 1, price $X, location Y
     etc ...	  
    

  3. Continue working with your code from last week. Now that you have a better understanding of parsing with Beautiful Soup, can you better implement the dynamic sitemap data scraping exercise?