Skip to content

Instantly share code, notes, and snippets.

@wintrdotcom
Last active September 7, 2020 00:02
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 wintrdotcom/e068a356fb725f9fd04baab5b5cd59e2 to your computer and use it in GitHub Desktop.
Save wintrdotcom/e068a356fb725f9fd04baab5b5cd59e2 to your computer and use it in GitHub Desktop.
Scrape Amazon product list by importing this JSON file into your WINTR dashboard on https://www.wintr.com/dashboard-querybuilder
{
"method": "GET",
"url": "https://www.amazon.com/s?k=phone",
"jsrender": true,
"renderuntil": "domloaded",
"headers": {
"Accept-Language": "en-US,en;q=0.9,es;q=0.8",
"Referer": "https://www.google.com"
},
"outputschema": {
"list": {
"group": ".s-search-results [data-component-type=\"s-search-result\"]",
"data": {
"name": {
"selector": "h2:first-of-type a.a-link-normal",
"attr": "*text*",
"replacer": [
{
"search": "\n",
"replace": ""
}
],
"modifier": [
"totrimmed"
]
},
"rating": {
"selector": ".a-icon-star-small",
"attr": "*text*",
"replacer": [
{
"search": " out of 5 stars",
"replace": ""
}
],
"modifier": [
"totrimmed"
]
},
"price": {
"selector": ".a-price:not(.a-text-price) .a-offscreen",
"attr": "*text*",
"modifier": [
"totrimmed"
]
},
"thumbnail": {
"selector": ".s-image",
"attr": "src",
"modifier": [
"totrimmed"
]
},
"link": {
"selector": "h2:first-of-type a.a-link-normal",
"attr": "href",
"modifier": [
"totrimmed"
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment