coding-ai / EasyApply-Linkedin

RPA tool for applying to LinkedIn jobs
237 stars 136 forks source link

crashed after chrome was loaded #11

Open notSoTechnical opened 1 year ago

notSoTechnical commented 1 year ago

Crashed after running the program

Wilson-D-Lee commented 1 year ago

I'm getting the same & here's the error I'm getting 😭

/usr/local/bin/python3.9 /Users/Admin/Downloads/EasyApply-Linkedin-master/main.py 
Traceback (most recent call last):
  File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 180, in <module>
    bot.apply()
  File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 163, in apply
    self.login_linkedin()
  File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 31, in login_linkedin
    login_email = self.driver.find_element_by_name('session_key')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'
nandlalyadav57 commented 1 year ago

/usr/local/bin/python3.9 /Users/Admin/Downloads/EasyApply-Linkedin-master/main.py Traceback (most recent call last): File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 180, in bot.apply() File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 163, in apply self.login_linkedin() File "/Users/Admin/Downloads/EasyApply-Linkedin-master/main.py", line 31, in login_linkedin login_email = self.driver.find_element_by_name('session_key') AttributeError: 'WebDriver' object has no attribute 'find_element_by_name'

you need to add credentials in config file

ace97 commented 9 months ago

I was also getting the same error. On searching for a quick fix, found that 'By' function along with supported attributes worked fine. Adding the code snippets and link to official selenium docs below.

Locating Elements using BY

from selenium.webdriver.common.by import By

The attributes available for the By class are used to locate elements on a page. These are the attributes available for By class:

ID = "id"
NAME = "name"
XPATH = "xpath"
LINK_TEXT = "link text"
PARTIAL_LINK_TEXT = "partial link text"
TAG_NAME = "tag name"
CLASS_NAME = "class name"
CSS_SELECTOR = "css selector"

The ‘By’ class is used to specify which attribute is used to locate elements on a page. These are the various ways the attributes are used to locate elements on a page:

find_element(By.ID, "id")
find_element(By.NAME, "name")
find_element(By.XPATH, "xpath")
find_element(By.LINK_TEXT, "link text")
find_element(By.PARTIAL_LINK_TEXT, "partial link text")
find_element(By.TAG_NAME, "tag name")
find_element(By.CLASS_NAME, "class name")
find_element(By.CSS_SELECTOR, "css selector")