Create a Python script that extracts product data from the first 20 pages of Amazon's search results for the query "keyboard" (e.g., https://www.amazon.it/s?k=keyboard&page=N). The script should:
- Iterate through pages 1 to 20.
- Use the API key: sgai-763dcc80-3a64-417f-b9bf-b98c8f50cc4b for ScrapeGraphAI.
- Extract the following product information per page, per product:
- Name
- Price
- Review stars
- Number of reviews
- Prime availability
- Store the extracted data in Elasticsearch.
- After populating the Elasticsearch index, run several interesting queries on the dataset (e.g., top-rated products, most-reviewed, price distribution, prime vs. non-prime products, etc.).
Please include:
- Robust error handling for possible scraping and storage failures.
- Clear instructions on dependencies and how to run the script.
- Example outputs for the queries on the dataset.
Repository: ScrapeGraphAI/scrapegraph-elasticsearch-demo