google-maps-scraper icon indicating copy to clipboard operation
google-maps-scraper copied to clipboard

Job results not saving to postgres table

Open vincerogers opened this issue 2 years ago • 8 comments

Following the readme instructions:

  1. Stand up docker container
  2. Successfully populate gmaps_jobs with go run main.go -dsn "postgres://postgres:postgres@localhost:5432/postgres" -produce -input example-queries.txt --lang el
  3. Run the process which successfully finishes: go run main.go -c 2 -depth 1 -dsn "postgres://postgres:postgres@localhost:5432/postgres"
  4. "results" table is empty upon completion

vincerogers avatar Dec 12 '23 14:12 vincerogers

this is a bug .

thank you very much for reporting this @vincerogers .

it is just fixed. Please try the latest main or tag v1.1.2

gosom avatar Dec 12 '23 17:12 gosom

Confirmed, that was a quick turnaround! Thank you!

vincerogers avatar Dec 12 '23 18:12 vincerogers

@gosom - Is there a chance that this fix might have broken the "-emails" capability? I'm not seeing the json emails property populated in my tests, and it looks like they aren't showing up in the csv based export either.

vincerogers avatar Dec 12 '23 19:12 vincerogers

go run main.go -depth 1 -input example-queries.txt -lang en -results test-out.csv -exit-on-inactivity 1m -email -debug -c 1

just run the above (in debug mode) and I got emails

gosom avatar Dec 12 '23 19:12 gosom

You are correct, that did produce emails on the output csv. However, when I run basically the same thing at postgres via: go run main.go -depth 1 -dsn "postgres://postgres:postgres@localhost:5432/postgres" -exit-on-inactivity 1m -email -c 1

Once complete, a query against the result table returns nulls for all emails: select data->>'title', data->>'web_site' , data->>'emails', data from results

Am I doing something wrong? Thanks for your help!

vincerogers avatar Dec 12 '23 20:12 vincerogers

You are correct, that did produce emails on the output csv. However, when I run basically the same thing at postgres via:

go run main.go -depth 1 -dsn "postgres://postgres:postgres@localhost:5432/postgres" -exit-on-inactivity 1m -email -c 1

Once complete, a query against the result table returns nulls for all emails:

select data->>'title', data->>'web_site' , data->>'emails', data from results

Am I doing something wrong? Thanks for your help!

I will check and let you know. It's a bit late for me now

gosom avatar Dec 12 '23 20:12 gosom

I confirmed that it's a bug.

I don't think it's trivial to fix and it will take some time. I will update the issue once this is fixed.

Thanks for reporting

gosom avatar Dec 13 '23 07:12 gosom

Is there any update on this? I am trying but am unable to collect emails when using this repo with a database.

Using -email flag ONLY when producing seed This creates a lot of jobs that error and fail - due to invalid job type. No emails are collected

Using -email flag BOTH when producing seeds and executing jobs This creates a lot of jobs that error and fail - due to invalid job type. No emails are collected

Using -email flag ONLY when executing jobs All jobs run successfully. No emails are collected

LL-AI-dev avatar Feb 13 '24 01:02 LL-AI-dev