TobiasPankner / Gleam-giveaway-bot

Python bot to automatically find and complete gleam giveaways.
GNU General Public License v3.0
91 stars 45 forks source link

Can not run Login.py anymore #20

Closed eliris closed 3 years ago

eliris commented 3 years ago

The script used to run well until a few days ago it gave me the error:

Traceback (most recent call last): File "C:\Dev\Python\Gleam-giveaway-bot\login.py", line 9, in <module> browser.init_driver(config['user-data-dir'], config['profile-directory'], headless=False) File "C:\Dev\Python\Gleam-giveaway-bot\src\browser.py", line 95, in init_driver driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options, desired_capabilities=caps) File "C:\Python39\lib\site-packages\webdriver_manager\chrome.py", line 29, in install driver_path = self.download_driver(self.driver) File "C:\Python39\lib\site-packages\webdriver_manager\manager.py", line 37, in download_driver driver_version, is_latest = self.__get_version_to_download(driver) File "C:\Python39\lib\site-packages\webdriver_manager\manager.py", line 28, in __get_version_to_download return self.__get_latest_driver_version(driver), True File "C:\Python39\lib\site-packages\webdriver_manager\manager.py", line 18, in __get_latest_driver_version latest_cached = self.driver_cache.get_latest_cached_driver_version(driver.get_name()) File "C:\Python39\lib\site-packages\webdriver_manager\driver_cache.py", line 98, in get_latest_cached_driver_version if not self.is_valid_cache(driver_name): File "C:\Python39\lib\site-packages\webdriver_manager\driver_cache.py", line 87, in is_valid_cache metadata = self.read_metadata() File "C:\Python39\lib\site-packages\webdriver_manager\driver_cache.py", line 108, in read_metadata return json.load(outfile) File "C:\Python39\lib\json\__init__.py", line 293, in load return loads(fp.read(), File "C:\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I tried reinstalling selenium, closing all chrome instances, recreating a new profile, reinstalling the requirements and the whole script etc. but so far nothing is working.

Has anybody ran into this issue?

eliris commented 3 years ago

Solved: I downloaded Chrome Driver from: https://sites.google.com/a/chromium.org/chromedriver/downloads Then I put the executable in my gleam-giveaway-bot folder I went to src/browser.py and replaced line 95 with:

driver = webdriver.Chrome(executable_path='C:\Dev\Python\Gleam-giveaway-bot\chromedriver.exe', chrome_options=options, desired_capabilities=caps)

It worked again