AnthonyZJiang / Microsoft-Rewards-Bot

Microsoft Rewards (Bing Rewards) Bot - automated selenium python bot
27 stars 4 forks source link

Chrome driver download broken #27

Open Chris9a opened 1 year ago

Chris9a commented 1 year ago

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.

PaC0h commented 1 year ago

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)
ashanrath commented 1 year ago

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