This project demonstrates a web scraping API using Golang with Gin and ChromeDP for dynamic site scraping.
- Go (version 1.16+ recommended)
- Git
- Chrome or Chromium browser (for ChromeDP scraper)
-
Clone the repository:
git clone https://github.com/zahidhasann88/go-web-scraper.git cd go-web-scraper
-
Install dependencies:
go mod tidy
-
Run the application
go run main.go
- Endpoint:
POST /scrape
- Description: Scrapes a website using ChromeDP or Colly based on the
useChromedp
flag.
- POST - http://localhost:8080/scrape
{
"url": "https://executivemachines.com",
"format": "json",
"filename": "scraped_data.json",
"useChromedp": true
}
This project utilizes the following technologies:
- Gin - Web framework for building APIs in Golang.
- ChromeDP - Headless Chrome DevTools Protocol for browser automation and scraping.
- Colly - Golang-based web scraping framework for extracting data from websites.