Product
Learn how to collect Grainger product page data using the grainger_product source with Web Scraper API.
The grainger_product data source is designed to retrieve Grainger product pages.
Request samples
In the samples below, we make a request to retrieve a product page for 1THX7.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "grainger_product",
"product_id": "1THX7",
"render": "html"
}'import requests
from pprint import pprint
# Structure payload.
payload = {
"source": "grainger_product",
"product_id": "1THX7",
"render": "html"
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with the result.
pprint(response.json())Request parameter values
Generic
Basic setup and customization options for scraping Grainger product pages.
Parameter
Description
Default Value
- mandatory parameter
Localization
Adapt results to specific domains
Parameter
Description
Default value
domain
Domain localization for different Grainger regions. (com, com.mx, ca)
com
Last updated
Was this helpful?

