-
-
Save alecxe/db5974eeb7da4cc1cc92 to your computer and use it in GitHub Desktop.
This file contains 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
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