Skip to content

Instantly share code, notes, and snippets.

@captivus
captivus / audible_matchmaker_scraping_gist2.py
Created April 26, 2020 17:29
Parse Audible Matchmaker data into something mathematically useful ...
# 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('$', '')
@captivus
captivus / audible_matchmaker_scraping_gist1.py
Last active April 26, 2020 17:31
Load BeautifulSoup and parse the Audible Matchmaker page ...
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')