This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # find all of the spans containing the audiobook price | |
| # (see accompanying Jupyter notebook for details) | |
| upgrade_prices = soup.findAll(name='span', attrs={'class' : 'a-size-base a-color-price a-text-bold'}) | |
| # iterate over each of the book prices | |
| for book in upgrade_prices: | |
| # convert the span price data to a string | |
| price_string = book.string | |
| # remove the dollar sign from the price string | |
| price_string = price_string.replace('$', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| # open Audible Matchmaker page locally | |
| # (see accompanying Jupyter notebook for details) | |
| infile = open(file='audible_matchmaker.html', mode='r') | |
| # parse the page with BeautifulSoup | |
| soup = BeautifulSoup(markup=infile, features='html.parser') |
NewerOlder