Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hilda04 opened this issue Jul 31, 2024 · 1 comment
Open

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

hilda04 opened this issue Jul 31, 2024 · 1 comment

Comments

@hilda04
Copy link

hilda04 commented Jul 31, 2024

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
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants