Skip to content

Instantly share code, notes, and snippets.

@tBaxter
Created July 5, 2014 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tBaxter/fc15b756422b86c5ca38 to your computer and use it in GitHub Desktop.
Save tBaxter/fc15b756422b86c5ca38 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
archive_guitar_url = 'http://web.archive.org/web/20140625050804id_/http://gretschpages.com/guitars/'
r = requests.get(archive_guitar_url)
soup = BeautifulSoup(r.text)
guitar_grid = soup.find("section", {"id":"grid"})
guitar_grid_children = guitar_grid.find_all('div')
... extracted the guitar families, now looking at the first of guitar_grid_children to extract models:
# first model resolution: 6120s:
model_list = guitar_grid_children[0].find("ul", {"id":"6120-models-details"})
model_names = model_list.find_all('a')
for item in model_names:
item.text.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment