Jimut123 / jimutmap

API to get enormous amount of high resolution satellite images from satellites.pro quickly through multi-threading! create map your own map dataset. Bringing data to Humans.
https://jimutmap.readthedocs.io/
GNU General Public License v3.0
145 stars 17 forks source link

Problem with token aquision #27

Closed KovacovicP closed 8 months ago

KovacovicP commented 1 year ago

Describe the bug After installing chrome into wsl along with required dependencies it fails to get token for the map or fails on inicialization of chrome auto installer package (see output below).

To Reproduce Steps to reproduce the behavior:

  1. Run python3 test.py

Expected behavior Receive satellite images from the scraper into chosen directory.

Screenshots

WARNING:root:Can not find chromedriver for currently installed chrome version.
Traceback (most recent call last):
  File "/home/patrik/jimutmap/test.py", line 15, in <module>
    from jimutmap import api, sanity_check, stitch_whole_tile
  File "/home/patrik/jimutmap/jimutmap/__init__.py", line 19, in <module>
    from .sanity_checker import sanity_check
  File "/home/patrik/jimutmap/jimutmap/sanity_checker.py", line 221, in <module>
    sanity_obj = api(min_lat_deg = 10,
  File "/home/patrik/jimutmap/jimutmap/jimutmap.py", line 86, in __init__
    self._getAPIKey()
  File "/home/patrik/jimutmap/jimutmap/jimutmap.py", line 189, in _getAPIKey
    driver = webdriver.Chrome(executable_path= chromeDriverPath, options=options)
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'

Desktop

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

felipeffm commented 1 year ago

Hi Kovacovic,

I'am also trying to use this library.

Your error is due to the new updates in selenium after version 4.9 that changed argument executable_path of webdriver class. That means the source code of jimutmap is not compatible with selenium > 4.9 , so if you do

pip install selenium == 4.8

will solve your problem

If someone has this library working locally, please use command pip freeze>requirements.txt to update requirements.txt and avoid this kind of issue.

felipeffm commented 1 year ago

@Jimut123

Jimut123 commented 1 year ago

Have to look into it, have exams next week, can't look before endsems get over. 😢

Sorry guys, try to fix it yourself, I'm totally out of touch with the repo.

cedricjoulain commented 11 months ago

Hello, Here is a fix:

diff --git a/jimutmap/jimutmap.py b/jimutmap/jimutmap.py
index e84318f..f5bcb9e 100644
--- a/jimutmap/jimutmap.py
+++ b/jimutmap/jimutmap.py
@@ -20,6 +20,7 @@ from tqdm import tqdm
 import multiprocessing
 from typing import Tuple
 from selenium import webdriver
+from selenium.webdriver.chrome.service import Service
 import chromedriver_autoinstaller
 from multiprocessing.pool import ThreadPool
 from os.path import join, exists, normpath, relpath
@@ -184,9 +185,10 @@ class api:
         SAMPLE_KEY = r"1614125879_3642792122889215637_%2F_RwvhYZM5fKknqTdkXih2Wcu3s2f3Xea126uoIuDzUIY%3D"
         KEY_START = r"&accessKey="
         chromeDriverPath = chromedriver_autoinstaller.install(cwd= True)
+        service = Service(executable_path=chromeDriverPath)
         options = webdriver.ChromeOptions()
         options.add_argument('headless')
-        driver = webdriver.Chrome(executable_path= chromeDriverPath, options=options)
+        driver = webdriver.Chrome(service=service, options=options)
         driver.get("https://satellites.pro/USA_map#37.405074,-94.284668,5")
         keyContents = None
         loopStartTime = dt.datetime.now()
stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.