wodsuz / EasyApplyJobsBot

A python bot to automatically apply all Linkedin,Glassdoor, etc Easy Apply jobs based on your preferences. Auto login, auto fill additional questions, apply automatically!
https://www.automated-bots.com/
Other
434 stars 139 forks source link

OSError: [WinError 193] %1 is not a valid Win32 application #66

Open hilda04 opened 1 month ago

hilda04 commented 1 month ago

Bot was working perfectly yesterday, but today throws this error, has anyone else come across this and how did you fix it?:

Traceback (most recent call last): File "C:\Users\xx\Documents\EasyApplyJobsBot-main\linkedin.py", line 248, in Linkedin().linkJobApply() ^^^^^^^^^^ File "C:\Users\xx\Documents\EasyApplyJobsBot-main\linkedin.py", line 15, in init self.driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),options=utils.chromeBrowserOptions()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in init super().init( File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 50, in init self.service.start() File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 98, in start self._start_process(self._path) File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\common\service.py", line 208, in _start_process self.process = subprocess.Popen( ^^^^^^^^^^^^^^^^^ File "C:\Users\x\AppDxata\Local\Programs\Python\Python311\Lib\subprocess.py", line 1022, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\xx\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1491, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [WinError 193] %1 is not a valid Win32 application

Kevin-Rush commented 1 week ago

It's not a perfect fix, but I got around this by changing the init method to this:

def init(self): utils.prYellow("🤖 Thanks for using Easy Apply Jobs bot, for more information you can visit our site - www.automated-bots.com") utils.prYellow("🌐 Bot will run in Chrome browser and log in Linkedin for you.")

        chrome_install = ChromeDriverManager().install()

        folder = os.path.dirname(chrome_install)
        chromedriver_path = os.path.join(folder, "chromedriver.exe")

        service = ChromeService(chromedriver_path)

        self.driver = webdriver.Chrome(service=service,options=utils.chromeBrowserOptions())

        self.cookies_path = f"{os.path.join(os.getcwd(),'cookies')}/{self.getHash(config.email)}.pkl"
        self.driver.get('https://www.linkedin.com')
        self.loadCookies()