Microsoft-Rewards-Bot icon indicating copy to clipboard operation
Microsoft-Rewards-Bot copied to clipboard

Chrome driver download broken

Open Chris9a opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "C:.Microsoft-Rewards-Bot-2.0.3\ms_rewards.py", line 119, in run_bot msr.work(flag_pc=parser.pc_mode, flag_mob=parser.mobile_mode, File "C:.Microsoft-Rewards-Bot-2.0.3\msreward\msr.py", line 35, in work if not self._start_browser(ua, log_in=True): File "C:.Microsoft-Rewards-Bot-2.0.3\msreward\msr.py", line 18, in _start_browser self.browser = Browser(self.headless_mode, user_agent) File "C:.Microsoft-Rewards-Bot-2.0.3\helper\browser.py", line 24, in init path = Browser._prepare_driver() File "C:.Microsoft-Rewards-Bot-2.0.3\helper\browser.py", line 41, in _prepare_driver download_driver(path, system) File "C:.Microsoft-Rewards-Bot-2.0.3\helper\driver.py", line 33, in download_driver os.rmdir(extracted_dir) OSError: [WinError 145] The directory is not empty: 'drivers\chromedriver_win32'

New error since there is a license agreement included with the driver in the download folder. I'm terrible at coding and found this temp fix https://stackoverflow.com/questions/1557351/python-delete-non-empty-dir. Probably a better way to go about it.

Chris9a avatar Jan 11 '23 07:01 Chris9a

just do the following hopefully it can be added

modify driver.py found in helper folder

at top of file at end of import section add import shutil

change below near line 34

    os.rm(extracted_dir)

to

    shutil.rmtree(extracted_dir)

PaC0h avatar Jan 11 '23 19:01 PaC0h

I'll raise a PR for this later today if nobody else does, thanks for the fix.

ashanrath avatar Jan 11 '23 20:01 ashanrath