Created
July 5, 2014 20:20
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 | |
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