Skip to content

renatoaraujo/go-zenrows

Repository files navigation

go-zenrows

Go Reference Go Report Card codecov

go-zenrows is a Go client for the ZenRows API, allowing users to easily scrape web content.

Features

  • Scrape Web Content: Easily scrape content from any website using the ZenRows API.
  • Flexible Configuration: Comes with a default configuration but allows for customization.
  • Various Scrape Options: Customize your scraping with options like JS rendering, custom headers, session ID, and more.
  • Examples Included: A basic example is provided to help you get started quickly.

Installation

go get github.com/renatoaraujo/go-zenrows

Usage

Here's a basic example to get you started:

hc := &http.Client{
    Timeout: time.Duration(60) * time.Second,
}
client := zenrows.NewClient(hc).WithApiKey("YOUR_API_KEY")

result, err := client.Scrape(context.TODO(), "https://httpbin.org", zenrows.WithJSRender())
if err != nil {
    log.Fatalf("Failed to scrape the target: %v", err)
}

fmt.Println("Scraped Content:", result)

View the full example here.

Documentation

For a detailed list of all available functions and scrape options, refer to the official documentation:

Credits

License

The MIT License (MIT) - see LICENSE for more details