AIHawk-FOSS / Auto_Jobs_Applier_AI_Agent

Auto_Jobs_Applier_AI_Agent by AIHawk is an AI Agent that automates the jobs application process. Utilizing artificial intelligence, it enables users to apply for multiple jobs in an automated and personalized way.
Other
22.37k stars 3.3k forks source link

Runtime error: Error running the bot: Failed to initialize browser: Message: unknown error: cannot find Chrome binary #339

Closed lscalize closed 2 months ago

lscalize commented 2 months ago

Hi, could anyone help me with this issue?

image

aimaanmansuri21 commented 2 months ago

I encountered this issue and what I did is simply deactivated the virtual environment and restarted my pc, it still kept happening, I repeated this process 3 times and on the third try, it just worked!

lscalize commented 2 months ago

I've been trying for a while, but it's still not working.

lscalize commented 2 months ago

@aimaanmansuri21 I'm trying to run it on Google Colab. Do you think that I need to try somewhere else?

lscalize commented 2 months ago

I've tried to solve it using chatgpt, but it did not work.

I've followed these steps below.

Could someone help me pls?

Update system

!apt-get update

Install Chromium and ChromeDriver

!apt-get install -y chromium-chromedriver !apt-get install -y chromium

Setup the Selenium to Use Chromium

from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options

Setup Chrome

chrome_options = Options() chrome_options.add_argument("--headless") # Modo headless chrome_options.add_argument("--no-sandbox") chrome_options.add_argument("--disable-dev-shm-usage") chrome_options.add_argument("--disable-gpu") chrome_options.add_argument("--remote-debugging-port=9222")

Directory Chrome and ChromeDriver

chrome_options.binary_location = '/usr/bin/chromium-browser' service = Service('/usr/lib/chromium-browser/chromedriver')

feder-cr commented 2 months ago

@lscalize i think you can use on Google collab, because colab don't have chrome

lscalize commented 2 months ago

@feder-cr so, what do you suggest? So I need to use the Jupyter notebook instead? Another tool?

lscalize commented 2 months ago

@feder-cr or is it possible to run it directly through github?

Lumexio commented 2 months ago

Same problem here i'm currently on Ubuntu 24

and im using my own Resume

Runtime error: Error running the bot: Failed to initialize browser: Message: unknown error: cannot find Chrome binary
Stacktrace:
#0 0x562187fd84e3 <unknown>
#1 0x562187d07c76 <unknown>
#2 0x562187d2e757 <unknown>
#3 0x562187d2d029 <unknown>
#4 0x562187d6bccc <unknown>
#5 0x562187d6b47f <unknown>
#6 0x562187d62de3 <unknown>
#7 0x562187d382dd <unknown>
#8 0x562187d3934e <unknown>
#9 0x562187f983e4 <unknown>
#10 0x562187f9c3d7 <unknown>
#11 0x562187fa6b20 <unknown>
#12 0x562187f9d023 <unknown>
#13 0x562187f6b1aa <unknown>
#14 0x562187fc16b8 <unknown>
#15 0x562187fc1847 <unknown>
#16 0x562187fd1243 <unknown>
#17 0x718e6ea9ca94 <unknown>
#18 0x718e6eb29c3c <unknown>

Refer to the configuration and troubleshooting guide: https://github.com/feder-cr/LinkedIn_AIHawk_automatic_job_application/blob/main/readme.md#configuration
talvinder commented 2 months ago

I am facing the same issue. I am running this on my local machine (macos monterey, 12.7.6). Pretty much the same error as well. This seems to be a deeper issue, I have been trying to troubleshoot for the last 3-4 hours.

talvinder commented 2 months ago

Okay. This is the solution that worked for me.

  1. Ensure webdriver_manager is Installed First, make sure that the webdriver_manager package is installed. This package will automatically download and manage the ChromeDriver binary for you.

pip install webdriver-manager

  1. Update create_driver_selenium Function Update the create_driver_selenium function in the lib_resume_builder_AIHawk/utils.py file to use webdriver_manager to install ChromeDriver and specify its path.

Updated Code

from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

def create_driver_selenium():
    options = get_chrome_browser_options()  # Use the method to get Chrome options

    # Use webdriver_manager to install and specify the path to ChromeDriver
    service = ChromeService(executable_path=ChromeDriverManager().install())

    return webdriver.Chrome(service=service, options=options)

The app ran like butter after this.

lscalize commented 2 months ago

@talvinder tks for the help.

I've followed your instructions and faced the same problem.

I think Google Colab is the issue. Which other tool do you suggest?

image

Lumexio commented 2 months ago

@lscalize @talvinder I find the solution to this problem if you are on linux

First of all you need to remove purge uninstall your google chrome installation Second install back chrome as a package with

dpkg i chrome-stable.deb

i explore the code and if you still have problems you can hard-code the chrome installation path as viewed on the screenshot image

lscalize commented 2 months ago

@Lumexio I'm not on linux, but I'm going to try it. Why not? Tks a lot.

talvinder commented 2 months ago

@talvinder tks for the help.

I've followed your instructions and faced the same problem.

I think Google Colab is the issue. Which other tool do you suggest?

image

I don't think this will work on google colab or GitHub codespaces, since it needs a chrome driver (basically a working chrome instance).

lscalize commented 2 months ago

@talvinder Tks. So, what would you suggest instead?

lscalize commented 2 months ago

I've tried many times and it did not work.

Could someone help me pls?

talvinder commented 2 months ago

I've tried many times and it did not work.

Could someone help me pls?

I ran this on my local machine (MacBook Pro) and with some tinkering it worked fine. The main issue on my local machine was path to chrome driver, once that was sorted, it worked.

To fix the path, I had to make some tweaks in the python package of LinkedInAI. I am forgetting what exactly it was. I will come back with the exact instructions that worked for me once I am in front of my machine.

lscalize commented 1 month ago

@talvinder thanks a lot for your support.

Once you remember I'd appreciate if you could share the solution here.