Uses latest scrapemate version adds go-rod support (#216)

This commit is contained in:
Georgios Komninos
2026-01-06 10:54:34 +02:00
committed by GitHub
parent 27f7745769
commit eef673bbd1
12 changed files with 260 additions and 103 deletions
+34 -2
View File
@@ -7,8 +7,8 @@ on:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
push_playwright_image:
name: Push Playwright Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
@@ -30,6 +30,38 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true
push_rod_image:
name: Push Rod Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: gosom/google-maps-scraper
flavor: |
suffix=-rod,onlatest=true
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.rod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+47
View File
@@ -0,0 +1,47 @@
# Build stage
FROM golang:1.25.5-trixie AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -tags rod -ldflags="-w -s" -o /usr/bin/google-maps-scraper
# Download Chromium for rod during build using the browser download tool
RUN go run github.com/go-rod/rod/lib/utils/get-browser@latest
# Final stage - using Debian base with minimal Chromium dependencies
FROM debian:trixie-slim
# Install only essential Chromium dependencies (combined in single layer, aggressive cleanup)
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libasound2t64 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libexpat1 \
libgbm1 \
libglib2.0-0 \
libnspr4 \
libnss3 \
libpango-1.0-0 \
libx11-6 \
libxcb1 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxkbcommon0 \
libxrandr2 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/* \
&& find /usr/share/doc -type f -delete \
&& find /usr/share/man -type f -delete \
&& find /usr/share/locale -type f -delete
COPY --from=builder /usr/bin/google-maps-scraper /usr/bin/
COPY --from=builder /root/.cache/rod /root/.cache/rod
ENTRYPOINT ["google-maps-scraper"]
+18 -1
View File
@@ -1,5 +1,5 @@
APP_NAME := google_maps_scraper
VERSION := 1.9.2
VERSION := 1.10.0
default: help
@@ -36,3 +36,20 @@ cross-compile: ## cross compiles the application
GOOS=linux GOARCH=amd64 go build -o bin/$(APP_NAME)-${VERSION}-linux-amd64
GOOS=darwin GOARCH=amd64 go build -o bin/$(APP_NAME)-${VERSION}-darwin-amd64
GOOS=windows GOARCH=amd64 go build -o bin/$(APP_NAME)-${VERSION}-windows-amd64.exe
build: ## builds the application (default: playwright)
go build -o bin/$(APP_NAME) .
build-rod: ## builds the application with go-rod browser engine
go build -tags rod -o bin/$(APP_NAME)-rod .
cross-compile-rod: ## cross compiles the application with go-rod
GOOS=linux GOARCH=amd64 go build -tags rod -o bin/$(APP_NAME)-${VERSION}-rod-linux-amd64
GOOS=darwin GOARCH=amd64 go build -tags rod -o bin/$(APP_NAME)-${VERSION}-rod-darwin-amd64
GOOS=windows GOARCH=amd64 go build -tags rod -o bin/$(APP_NAME)-${VERSION}-rod-windows-amd64.exe
docker: ## builds docker image with playwright (default)
docker build -t $(APP_NAME):$(VERSION) .
docker-rod: ## builds docker image with go-rod
docker build -f Dockerfile.rod -t $(APP_NAME):$(VERSION)-rod .
+20 -1
View File
@@ -150,6 +150,8 @@ touch results.csv && docker run \
-exit-on-inactivity 3m
```
> **Tip:** Use `gosom/google-maps-scraper:latest-rod` for the Rod version with faster container startup.
**Want emails?** Add the `-email` flag.
**Want all reviews (up to ~300)?** Add `--extra-reviews` and use `-json` output.
@@ -174,8 +176,19 @@ Full OpenAPI 3.0.3 documentation available at http://localhost:8080/api/docs
### Using Docker (Recommended)
Two Docker image variants are available:
| Image | Tag | Browser Engine | Best For |
|-------|-----|----------------|----------|
| Playwright (default) | `latest`, `vX.X.X` | Playwright | Most users, better stability |
| Rod | `latest-rod`, `vX.X.X-rod` | Rod/Chromium | Lightweight, faster startup |
```bash
# Playwright version (default)
docker pull gosom/google-maps-scraper
# Rod version (alternative)
docker pull gosom/google-maps-scraper:latest-rod
```
### Build from Source
@@ -186,11 +199,17 @@ Requirements: Go 1.25.5+
git clone https://github.com/gosom/google-maps-scraper.git
cd google-maps-scraper
go mod download
# Playwright version (default)
go build
./google-maps-scraper -input example-queries.txt -results results.csv -exit-on-inactivity 3m
# Rod version (alternative)
go build -tags rod
./google-maps-scraper -input example-queries.txt -results results.csv -exit-on-inactivity 3m
```
> First run downloads required Playwright browser libraries.
> First run downloads required browser libraries (Playwright or Chromium depending on version).
---
+44 -46
View File
@@ -11,7 +11,6 @@ import (
"github.com/PuerkitoBio/goquery"
"github.com/google/uuid"
"github.com/gosom/scrapemate"
"github.com/playwright-community/playwright-go"
"github.com/gosom/google-maps-scraper/deduper"
"github.com/gosom/google-maps-scraper/exiter"
@@ -152,12 +151,10 @@ func (j *GmapJob) Process(ctx context.Context, resp *scrapemate.Response) (any,
return nil, next, nil
}
func (j *GmapJob) BrowserActions(ctx context.Context, page playwright.Page) scrapemate.Response {
func (j *GmapJob) BrowserActions(ctx context.Context, page scrapemate.BrowserPage) scrapemate.Response {
var resp scrapemate.Response
pageResponse, err := page.Goto(j.GetFullURL(), playwright.PageGotoOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
})
pageResponse, err := page.Goto(j.GetFullURL(), scrapemate.WaitUntilDOMContentLoaded)
if err != nil {
resp.Error = err
@@ -166,34 +163,24 @@ func (j *GmapJob) BrowserActions(ctx context.Context, page playwright.Page) scra
clickRejectCookiesIfRequired(page)
const defaultTimeout = 5000
const defaultTimeout = 5 * time.Second
err = page.WaitForURL(page.URL(), playwright.PageWaitForURLOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
Timeout: playwright.Float(defaultTimeout),
})
err = page.WaitForURL(page.URL(), defaultTimeout)
if err != nil {
resp.Error = err
return resp
}
resp.URL = pageResponse.URL()
resp.StatusCode = pageResponse.Status()
resp.Headers = make(http.Header, len(pageResponse.Headers()))
for k, v := range pageResponse.Headers() {
resp.Headers.Add(k, v)
}
resp.URL = pageResponse.URL
resp.StatusCode = pageResponse.StatusCode
resp.Headers = pageResponse.Headers
// When Google Maps finds only 1 place, it slowly redirects to that place's URL
// check element scroll
sel := `div[role='feed']`
//nolint:staticcheck // TODO replace with the new playwright API
_, err = page.WaitForSelector(sel, playwright.PageWaitForSelectorOptions{
Timeout: playwright.Float(700),
})
err = page.WaitForSelector(sel, 700*time.Millisecond)
var singlePlace bool
@@ -242,7 +229,7 @@ func (j *GmapJob) BrowserActions(ctx context.Context, page playwright.Page) scra
return resp
}
func waitUntilURLContains(ctx context.Context, page playwright.Page, s string) bool {
func waitUntilURLContains(ctx context.Context, page scrapemate.BrowserPage, s string) bool {
ticker := time.NewTicker(time.Millisecond * 150)
defer ticker.Stop()
@@ -258,27 +245,33 @@ func waitUntilURLContains(ctx context.Context, page playwright.Page, s string) b
}
}
func clickRejectCookiesIfRequired(page playwright.Page) {
sel := `form[action="https://consent.google.com/save"] input[type="submit"]`
locator := page.Locator(sel)
count, err := locator.Count()
if err != nil {
return
}
if count == 0 {
return
}
_ = locator.First().Click(playwright.LocatorClickOptions{
Timeout: playwright.Float(2000),
})
func clickRejectCookiesIfRequired(page scrapemate.BrowserPage) {
// Use JavaScript to find and click - faster than multiple locator calls
_, _ = page.Eval(`() => {
// Try consent form buttons first
const consentForm = document.querySelector('form[action*="consent.google"]');
if (consentForm) {
const btn = consentForm.querySelector('button, input[type="submit"]');
if (btn) {
btn.click();
return true;
}
}
// Try reject/decline buttons
const buttons = document.querySelectorAll('button, input[type="submit"]');
for (const btn of buttons) {
const text = (btn.textContent || btn.value || '').toLowerCase();
if (text.includes('reject') || text.includes('decline') || text.includes('ablehnen')) {
btn.click();
return true;
}
}
return false;
}`)
}
func scroll(ctx context.Context,
page playwright.Page,
page scrapemate.BrowserPage,
maxDepth int,
scrollSelector string,
) (int, error) {
@@ -312,14 +305,20 @@ func scroll(ctx context.Context,
}
// Scroll to the bottom of the page.
scrollHeight, err := page.Evaluate(fmt.Sprintf(expr, waitTime2))
scrollHeight, err := page.Eval(fmt.Sprintf(expr, waitTime2))
if err != nil {
return cnt, err
}
height, ok := scrollHeight.(int)
if !ok {
return cnt, fmt.Errorf("scrollHeight is not an int")
// Handle both int and float64 (go-rod returns float64 for numbers)
var height int
switch v := scrollHeight.(type) {
case int:
height = v
case float64:
height = int(v)
default:
return cnt, fmt.Errorf("scrollHeight is not a number, got %T", scrollHeight)
}
if height == currentScrollHeight {
@@ -340,8 +339,7 @@ func scroll(ctx context.Context,
waitTime = maxWait2
}
//nolint:staticcheck // TODO replace with the new playwright API
page.WaitForTimeout(waitTime)
page.WaitForTimeout(time.Duration(waitTime) * time.Millisecond)
}
return cnt, nil
+32 -30
View File
@@ -3,13 +3,11 @@ package gmaps
import (
"context"
"fmt"
"net/http"
"strings"
"time"
"github.com/google/uuid"
"github.com/gosom/scrapemate"
"github.com/playwright-community/playwright-go"
"github.com/gosom/google-maps-scraper/exiter"
)
@@ -114,12 +112,10 @@ func (j *PlaceJob) Process(_ context.Context, resp *scrapemate.Response) (any, [
return &entry, nil, err
}
func (j *PlaceJob) BrowserActions(ctx context.Context, page playwright.Page) scrapemate.Response {
func (j *PlaceJob) BrowserActions(ctx context.Context, page scrapemate.BrowserPage) scrapemate.Response {
var resp scrapemate.Response
pageResponse, err := page.Goto(j.GetURL(), playwright.PageGotoOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
})
pageResponse, err := page.Goto(j.GetURL(), scrapemate.WaitUntilDOMContentLoaded)
if err != nil {
resp.Error = err
@@ -128,25 +124,18 @@ func (j *PlaceJob) BrowserActions(ctx context.Context, page playwright.Page) scr
clickRejectCookiesIfRequired(page)
const defaultTimeout = 5000
const defaultTimeout = 5 * time.Second
err = page.WaitForURL(page.URL(), playwright.PageWaitForURLOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
Timeout: playwright.Float(defaultTimeout),
})
err = page.WaitForURL(page.URL(), defaultTimeout)
if err != nil {
resp.Error = err
return resp
}
resp.URL = pageResponse.URL()
resp.StatusCode = pageResponse.Status()
resp.Headers = make(http.Header, len(pageResponse.Headers()))
for k, v := range pageResponse.Headers() {
resp.Headers.Add(k, v)
}
resp.URL = pageResponse.URL
resp.StatusCode = pageResponse.StatusCode
resp.Headers = pageResponse.Headers
raw, err := j.extractJSON(page)
if err != nil {
@@ -187,23 +176,40 @@ func (j *PlaceJob) BrowserActions(ctx context.Context, page playwright.Page) scr
return resp
}
func (j *PlaceJob) getRaw(ctx context.Context, page playwright.Page) (any, error) {
func (j *PlaceJob) getRaw(ctx context.Context, page scrapemate.BrowserPage) (any, error) {
for {
select {
case <-ctx.Done():
return nil, fmt.Errorf("timeout while getting raw data: %w", ctx.Err())
default:
raw, err := page.Evaluate(js)
if err == nil && raw != nil {
return raw, nil
raw, err := page.Eval(js)
if err != nil {
// Continue retrying on error
<-time.After(time.Millisecond * 200)
continue
}
<-time.After(time.Millisecond * 200)
// Check for valid non-null result
// go-rod may return nil for JS null, or empty string
if raw == nil {
<-time.After(time.Millisecond * 200)
continue
}
// If it's a string, make sure it's not empty
if str, ok := raw.(string); ok {
if str == "" {
<-time.After(time.Millisecond * 200)
continue
}
}
return raw, nil
}
}
}
func (j *PlaceJob) extractJSON(page playwright.Page) ([]byte, error) {
func (j *PlaceJob) extractJSON(page scrapemate.BrowserPage) ([]byte, error) {
const maxRetries = 2
for attempt := range maxRetries {
@@ -215,9 +221,7 @@ func (j *PlaceJob) extractJSON(page playwright.Page) ([]byte, error) {
if err != nil {
// On timeout, try reloading the page
if attempt < maxRetries-1 {
if _, reloadErr := page.Reload(playwright.PageReloadOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
}); reloadErr == nil {
if reloadErr := page.Reload(scrapemate.WaitUntilDOMContentLoaded); reloadErr == nil {
continue
}
}
@@ -227,9 +231,7 @@ func (j *PlaceJob) extractJSON(page playwright.Page) ([]byte, error) {
if rawI == nil {
if attempt < maxRetries-1 {
if _, reloadErr := page.Reload(playwright.PageReloadOptions{
WaitUntil: playwright.WaitUntilStateDomcontentloaded,
}); reloadErr == nil {
if reloadErr := page.Reload(scrapemate.WaitUntilDOMContentLoaded); reloadErr == nil {
continue
}
}
+7 -8
View File
@@ -16,11 +16,10 @@ import (
"github.com/gosom/scrapemate"
"github.com/gosom/scrapemate/adapters/fetchers/stealth"
"github.com/playwright-community/playwright-go"
)
type fetchReviewsParams struct {
page playwright.Page
page scrapemate.BrowserPage
mapURL string
reviewCount int
}
@@ -123,7 +122,7 @@ func (f *fetcher) fetchWithBrowser(_ context.Context, initialURL, requestID stri
}
}`, initialURL)
result, err := page.Evaluate(jsCode)
result, err := page.Eval(jsCode)
if err != nil {
return ans, fmt.Errorf("browser fetch failed: %w", err)
}
@@ -167,7 +166,7 @@ func (f *fetcher) fetchWithBrowser(_ context.Context, initialURL, requestID stri
}
}`, nextURL)
result, err = page.Evaluate(jsCode)
result, err = page.Eval(jsCode)
if err != nil {
break
}
@@ -356,11 +355,11 @@ func ConvertDOMReviewsToReviews(domReviews []DOMReview) []Review {
// extractReviewsFromPage extracts reviews directly from the page DOM
// This is a fallback when the RPC API fails
func extractReviewsFromPage(ctx context.Context, page playwright.Page) ([]DOMReview, error) {
func extractReviewsFromPage(ctx context.Context, page scrapemate.BrowserPage) ([]DOMReview, error) {
log.Printf("Attempting DOM-based review extraction")
// First, try to click the reviews section to open the reviews panel
clickedReviews, _ := page.Evaluate(`() => {
clickedReviews, _ := page.Eval(`() => {
try {
// Method 1: Click on the reviews count/link in the place info
const reviewsButtons = document.querySelectorAll('button[jsaction*="reviewChart"], button[jsaction*="reviews"]');
@@ -426,7 +425,7 @@ func extractReviewsFromPage(ctx context.Context, page playwright.Page) ([]DOMRev
}
// Extract reviews from the DOM - updated for Dec 2025 Google Maps structure
reviewsJSON, err := page.Evaluate(`() => {
reviewsJSON, err := page.Eval(`() => {
try {
const reviews = [];
@@ -689,7 +688,7 @@ func extractReviewsFromPage(ctx context.Context, page playwright.Page) ([]DOMRev
}
// Scroll to load more reviews
_, _ = page.Evaluate(`() => {
_, _ = page.Eval(`() => {
try {
// Try multiple scroll containers
const selectors = [
+11 -4
View File
@@ -14,11 +14,11 @@ require (
github.com/google/open-location-code/go v0.0.0-20250415120251-fa6d7f9d4765
github.com/google/uuid v1.6.0
github.com/gosom/go-leadsdb v0.0.0-20251228094956-ed313efc171f
github.com/gosom/scrapemate v0.9.6
github.com/gosom/scrapemate v1.0.0
github.com/jackc/pgx/v5 v5.7.4
github.com/mattn/go-runewidth v0.0.16
github.com/mcnijman/go-emailaddress v1.1.1
github.com/playwright-community/playwright-go v0.5200.0
github.com/playwright-community/playwright-go v0.5200.1
github.com/posthog/posthog-go v1.5.2
github.com/shirou/gopsutil/v4 v4.25.4
github.com/stretchr/testify v1.10.0
@@ -107,6 +107,8 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.26.0 // indirect
github.com/go-rod/rod v0.116.2 // indirect
github.com/go-rod/stealth v0.4.9 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
@@ -240,6 +242,11 @@ require (
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.3.0 // indirect
github.com/ykadowak/zerologlint v0.1.5 // indirect
github.com/ysmood/fetchup v0.2.3 // indirect
github.com/ysmood/goob v0.4.0 // indirect
github.com/ysmood/got v0.40.0 // indirect
github.com/ysmood/gson v0.7.3 // indirect
github.com/ysmood/leakless v0.9.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.13.0 // indirect
@@ -253,7 +260,7 @@ require (
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/sys v0.39.0 // indirect
golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 // indirect
golang.org/x/text v0.27.0 // indirect
golang.org/x/tools v0.34.0 // indirect
@@ -275,4 +282,4 @@ tool (
golang.org/x/vuln/cmd/govulncheck
)
//replace github.com/gosom/scrapemate v0.9.5 => ../scrapemate
//replace github.com/gosom/scrapemate v0.9.6 => ../scrapemate
+28 -6
View File
@@ -191,6 +191,11 @@ github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-rod/rod v0.113.0/go.mod h1:aiedSEFg5DwG/fnNbUOTPMTTWX3MRj6vIs/a684Mthw=
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg=
github.com/go-rod/stealth v0.4.9 h1:X2PmQk4DUF2wzw6GOsWjW/glb8K5ebnftbEvLh7MlZ4=
github.com/go-rod/stealth v0.4.9/go.mod h1:eAzyvw8c0iAd5nJJsSWeh0fQ5z94vCIfdi1hUmYDimc=
github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
@@ -271,8 +276,8 @@ github.com/gosom/go-leadsdb v0.0.0-20251228094956-ed313efc171f h1:8KIQahEHhRiH57
github.com/gosom/go-leadsdb v0.0.0-20251228094956-ed313efc171f/go.mod h1:OMwL4AkjK8P5taMjIMORw06LA9nszTY+WKnYlScLP+M=
github.com/gosom/kit v0.0.0-20230309082109-543b32ac686a h1:5tcB33GTXm0pFUiEFpmE91tMsHQj+I+W7zubT8J/ugI=
github.com/gosom/kit v0.0.0-20230309082109-543b32ac686a/go.mod h1:ngnWSsuBEpCA5Y43kZRa3x8RBYZZ4LDtvZHO4N5dHZ0=
github.com/gosom/scrapemate v0.9.6 h1:Ehpqr8ivgTHpYk3+7v197k3Bpg0JrlcWp7vdDydDH+c=
github.com/gosom/scrapemate v0.9.6/go.mod h1:chxTDXrw/Wfs2jX1iFWfWmA9IDKLw5kviSxjttoqtqo=
github.com/gosom/scrapemate v1.0.0 h1:OCFvBn2oAXfg4OBiG3OWziujXPbQWIf1kMSU7DUB+gs=
github.com/gosom/scrapemate v1.0.0/go.mod h1:5H14ZH5GN6VHbNmiNwZC0thGN4Ehc+2jpFnkuUgoTSQ=
github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk=
github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc=
github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado=
@@ -419,8 +424,8 @@ github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/playwright-community/playwright-go v0.5200.0 h1:z/5LGuX2tBrg3ug1HupMXLjIG93f1d2MWdDsNhkMQ9c=
github.com/playwright-community/playwright-go v0.5200.0/go.mod h1:UnnyQZaqUOO5ywAZu60+N4EiWReUqX1MQBBA3Oofvf8=
github.com/playwright-community/playwright-go v0.5200.1 h1:Sm2oOuhqt0M5Y4kUi/Qh9w4cyyi3ZIWTBeGKImc2UVo=
github.com/playwright-community/playwright-go v0.5200.1/go.mod h1:UnnyQZaqUOO5ywAZu60+N4EiWReUqX1MQBBA3Oofvf8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/polyfloyd/go-errorlint v1.7.1 h1:RyLVXIbosq1gBdk/pChWA8zWYLsq9UEw7a1L5TVMCnA=
@@ -568,6 +573,23 @@ github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5Jsjqto
github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4=
github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw=
github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg=
github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ=
github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns=
github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ=
github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18=
github.com/ysmood/gop v0.0.2/go.mod h1:rr5z2z27oGEbyB787hpEcx4ab8cCiPnKxn0SUHt6xzk=
github.com/ysmood/gop v0.2.0 h1:+tFrG0TWPxT6p9ZaZs+VY+opCvHU8/3Fk6BaNv6kqKg=
github.com/ysmood/gop v0.2.0/go.mod h1:rr5z2z27oGEbyB787hpEcx4ab8cCiPnKxn0SUHt6xzk=
github.com/ysmood/got v0.34.1/go.mod h1:yddyjq/PmAf08RMLSwDjPyCvHvYed+WjHnQxpH851LM=
github.com/ysmood/got v0.40.0 h1:ZQk1B55zIvS7zflRrkGfPDrPG3d7+JOza1ZkNxcc74Q=
github.com/ysmood/got v0.40.0/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg=
github.com/ysmood/gotrace v0.6.0 h1:SyI1d4jclswLhg7SWTL6os3L1WOKeNn/ZtzVQF8QmdY=
github.com/ysmood/gotrace v0.6.0/go.mod h1:TzhIG7nHDry5//eYZDYcTzuJLYQIkykJzCRIo4/dzQM=
github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE=
github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg=
github.com/ysmood/leakless v0.8.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ=
github.com/ysmood/leakless v0.9.0 h1:qxCG5VirSBvmi3uynXFkcnLMzkphdh3xx5FtrORwDCU=
github.com/ysmood/leakless v0.9.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -695,8 +717,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7 h1:FemxDzfMUcK2f3YY4H+05K9CDzbSVr2+q/JKN45pey0=
golang.org/x/telemetry v0.0.0-20240522233618-39ace7a40ae7/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
+14
View File
@@ -141,6 +141,10 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-rod/rod v0.116.2 h1:A5t2Ky2A+5eD/ZJQr1EfsQSe5rms5Xof/qj296e+ZqA=
github.com/go-rod/rod v0.116.2/go.mod h1:H+CMO9SCNc2TJ2WfrG+pKhITz57uGNYU43qYHh438Mg=
github.com/go-rod/stealth v0.4.9 h1:X2PmQk4DUF2wzw6GOsWjW/glb8K5ebnftbEvLh7MlZ4=
github.com/go-rod/stealth v0.4.9/go.mod h1:eAzyvw8c0iAd5nJJsSWeh0fQ5z94vCIfdi1hUmYDimc=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
@@ -388,6 +392,16 @@ github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
github.com/ysmood/fetchup v0.2.3 h1:ulX+SonA0Vma5zUFXtv52Kzip/xe7aj4vqT5AJwQ+ZQ=
github.com/ysmood/fetchup v0.2.3/go.mod h1:xhibcRKziSvol0H1/pj33dnKrYyI2ebIvz5cOOkYGns=
github.com/ysmood/goob v0.4.0 h1:HsxXhyLBeGzWXnqVKtmT9qM7EuVs/XOgkX7T6r1o1AQ=
github.com/ysmood/goob v0.4.0/go.mod h1:u6yx7ZhS4Exf2MwciFr6nIM8knHQIE22lFpWHnfql18=
github.com/ysmood/got v0.40.0 h1:ZQk1B55zIvS7zflRrkGfPDrPG3d7+JOza1ZkNxcc74Q=
github.com/ysmood/got v0.40.0/go.mod h1:W7DdpuX6skL3NszLmAsC5hT7JAhuLZhByVzHTq874Qg=
github.com/ysmood/gson v0.7.3 h1:QFkWbTH8MxyUTKPkVWAENJhxqdBa4lYTQWqZCiLG6kE=
github.com/ysmood/gson v0.7.3/go.mod h1:3Kzs5zDl21g5F/BlLTNcuAGAYLKt2lV5G8D1zF3RNmg=
github.com/ysmood/leakless v0.9.0 h1:qxCG5VirSBvmi3uynXFkcnLMzkphdh3xx5FtrORwDCU=
github.com/ysmood/leakless v0.9.0/go.mod h1:R8iAXPRaG97QJwqxs74RdwzcRHT1SWCGTNqY8q0JvMQ=
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg=
github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ=
+1 -2
View File
@@ -206,8 +206,7 @@ func (r *fileRunner) setApp() error {
opts = append(opts, scrapemateapp.WithJS(
scrapemateapp.Headfull(),
scrapemateapp.DisableImages(),
),
)
))
} else {
opts = append(opts, scrapemateapp.WithJS(scrapemateapp.DisableImages()))
}
+4 -3
View File
@@ -139,11 +139,12 @@ func (l *lambdaAwsRunner) getApp(_ context.Context, input lInput, out io.Writer)
opts := []func(*scrapemateapp.Config) error{
scrapemateapp.WithConcurrency(max(1, input.Concurrency)),
scrapemateapp.WithExitOnInactivity(time.Minute),
scrapemateapp.WithJS(
scrapemateapp.DisableImages(),
),
}
opts = append(opts, scrapemateapp.WithJS(
scrapemateapp.DisableImages(),
))
if !input.DisablePageReuse {
opts = append(opts, scrapemateapp.WithPageReuseLimit(2))
opts = append(opts, scrapemateapp.WithBrowserReuseLimit(200))