Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors When Running #1

Open
teamcoltra opened this issue Feb 2, 2023 · 1 comment
Open

Errors When Running #1

teamcoltra opened this issue Feb 2, 2023 · 1 comment

Comments

@teamcoltra
Copy link

Hey, I keep getting an error when running this in browser. It looks like the API key and URL is returning just fine... but it's throwing an error actually displaying it.

teamcoltra@DESKTOP-HFQNGG7:~/Google-Maps-Places-Scraper-main$ streamlit run main.py

Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.


  You can now view your Streamlit app in your browser.

  Network URL: http://***:8501
  External URL: http://***:8501

https://maps.googleapis.com/maps/api/place/textsearch/json?query=Board Game+Bellingham,+WA&key=***
2023-02-02 07:37:21.654 Uncaught app exception
Traceback (most recent call last):
  File "/home/teamcoltra/.local/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/home/teamcoltra/Google-Maps-Places-Scraper-main/main.py", line 384, in <module>
    places_df = get_places_df(query_url)
  File "/home/teamcoltra/Google-Maps-Places-Scraper-main/main.py", line 85, in get_places_df
    r = r['result']
KeyError: 'result'
Bellingham
['Marietta-Alderwood'] (48.7562157, -122.4894588) Bellingham
https://maps.googleapis.com/maps/api/place/textsearch/json?query=board game+marietta-alderwood+bellingham&key=***
NAME ['Endgame Bellingham', 'Positive Atmosphere', "Pair o' Dice Games", 'Cosmic Games', 'Reset Games', 'Aegis Games', 'Warhammer', 'The Comics Place', 'Ruckus Room Arcade and Fun Center', 'Launching Success', 'WISHES', 'LockBreaker Escapes LLC', '1-Up Lounge', 'Bellingham Youth Chess', 'Barnes & Noble', 'GameStop', 'NW Corner Goods', 'The Eureka Room', 'GameStop', 'Horseshoe Cafe']
RATING [4.6, 0, 4.9, 4.6, 4.5, 4.8, 4.9, 4.8, 4.6, 4.7, 4.4, 5, 4.6, 0, 4.5, 4.2, 5, 4.6, 4, 4.2]
USERTOTALRATING [136, 0, 101, 269, 482, 21, 59, 511, 412, 138, 61, 27, 543, 0, 1278, 176, 9, 45, 168, 971]
ADDRESS ['118 W Holly St, Bellingham, WA 98225, United States', '1522 Cornwall Ave, Bellingham, WA 98225, United States', '4152 Meridian St #113, Bellingham, WA 98226, United States', '3930 Meridian St Suite 101, Bellingham, WA 98226, United States', '1255 Barkley Blvd #101, Bellingham, WA 98226, United States', '1431 Railroad Ave, Bellingham, WA 98225, United States', '1200 10th St, Bellingham, WA 98225, United States', '105 E Holly St, Bellingham, WA 98225, United States', '1423 Railroad Ave, Bellingham, WA 98225, United States', '133 Prince Ave, Bellingham, WA 98226, United States', '1 Bellis Fair Pkwy, Bellingham, WA 98226, United States', '1208 Bay St Suite 105, Bellingham, WA 98225, United States', '1121 McKenzie Ave, Bellingham, WA 98225, United States', '4120 Meridian St #270, Bellingham, WA 98226, United States', '4099 Meridian St, Bellingham, WA 98226, United States', '1 Bellis Fair Pkwy, Bellingham, WA 98226, United States', '1230 Cornwall Ave, Bellingham, WA 98225, United States', '114 W Magnolia St #105, Bellingham, WA 98225, United States', '1225 E Sunset Dr #100, Bellingham, WA 98226, United States', '113 E Holly St, Bellingham, WA 98225, United States']
PLACE ID ['ChIJP-LvFCajhVQRtZNbDz3hdD8', 'ChIJj6Wdf72jhVQR8X9TfbEl4pw', 'ChIJYQq3UKekhVQR4wOh78hPwmQ', 'ChIJBRFgJZijhVQRlqDxbolrPfM', 'ChIJO8kG4n-khVQRn_z2Z_kIUDE', 'ChIJxYWx1bmjhVQRDSFnf15N62c', 'ChIJ47xbgiGihVQRb5wP1FDbh0A', 'ChIJkWdxkLyjhVQRx_LCgynBwQs', 'ChIJy9Knvr2jhVQR4oG3xgziNsY', 'ChIJQ6CDraCkhVQRToQiRDmNdpY', 'ChIJx5ieuF2jhVQRoSHDyC86Z2w', 'ChIJa8CRIAejhVQREH0Wy7omfOo', 'ChIJK3ar7iOihVQR1SFIH3LSX6Y', 'ChIJ9wZm5hujhVQRAvKPAjuP4Ko', 'ChIJ2xZeFV-jhVQRE_oyNIZ8dWQ', 'ChIJMafKwF2jhVQRrbVsBc1Uphg', 'ChIJ_9ur-MOjhVQRcH7kdeHh_j0', 'ChIJ__-PT7mjhVQRgHcva-nwX7o', 'ChIJQzurqIGkhVQRi8Tn7T8qTVk', 'ChIJA84AF7yjhVQRyFNVG-Grvr8']
2023-02-02 07:37:51.272 Uncaught app exception
Traceback (most recent call last):
  File "/home/teamcoltra/.local/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/home/teamcoltra/Google-Maps-Places-Scraper-main/main.py", line 326, in <module>
    places_df = get_places_df(query_list)
  File "/home/teamcoltra/Google-Maps-Places-Scraper-main/main.py", line 205, in get_places_df
    r = r['result']
KeyError: 'result'
^C  Stopping...

@afourka
Copy link

afourka commented Mar 26, 2023

hello @teamcoltra

  • The google maps api key is hard coded in main.py at line 79 you should replace this key by yours
  • Make sure the yout billing account is also ensabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants