web scraper designed to extract product information from e-commerce Websites using AgentQL and Playwright and store the results in a CSV file.
- Scrapes product name, price, number of reviews, and rating from ce-commerce Websites
- Handles pagination to scrape multiple pages of results
- Stores scraped data in a CSV file
Before you begin, ensure you have met the following requirements:
- Python 3.9+
- pip
-
Clone this repository:
https://github.com/Hassn11q/Agentic-Scraper.git cd Agentic-Scraper
-
Install the required Python packages:
pip install -r requirements.txt
-
Install Playwright browsers:
playwright install
-
Get your AgentQL API key from AgentQL Dashboard
-
Create a
.env
file in the project root and add your AgentQL API key:AGENTQL_API_KEY=your_api_key_here
-
Open
agent.py
and modify theurl
variable if you want to scrape a different search results page. -
Run the scraper:
python agent.py
You can modify the following variables in agent.py
to customize the scraper's behavior:
url
: The search results URL to scrapePRODUCT_QUERY
: The GraphQL query for product dataPAGINATION_QUERY
: The GraphQL query for pagination data
- AgentQL for providing the querying capabilities
- Playwright for browser automation Agentic-Scraper