Skip to content

Instantly share code, notes, and snippets.

@alecxe
Created December 23, 2014 00:30
Show Gist options
  • Save alecxe/db5974eeb7da4cc1cc92 to your computer and use it in GitHub Desktop.
Save alecxe/db5974eeb7da4cc1cc92 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import requests
endpoint = "http://www.hhgregg.com/webapp/wcs/stores/servlet/CategoryNavigationResultsView"
data = {
"contentBeginIndex": "0",
"productBeginIndex": "12",
"beginIndex": "12",
"orderBy": "6",
"isHistory": "false",
"pageView": "image",
"resultType": "products",
"orderByContent": "",
"searchTerm": "",
"facet": "",
"minPrice": "",
"maxPrice": "",
"resultsPerPage": "12",
"storeId": "10154",
"catalogId": "10051",
"langId": "-1",
"NUMITEMSINCART": " item(s)",
"objectId": "",
"requesttype": "ajax",
}
s = requests.Session()
r = s.post(endpoint, data=data)
soup = BeautifulSoup(r.content)
for item in soup.select('div.information h3 a'):
print item.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment