EasyApply-Linkedin icon indicating copy to clipboard operation
EasyApply-Linkedin copied to clipboard

crashed after chrome was loaded

Open notSoTechnical opened this issue 2 years ago • 3 comments

Crashed after running the program

notSoTechnical avatar Nov 22 '22 04:11 notSoTechnical

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'

Wilson-D-Lee avatar Nov 30 '22 19:11 Wilson-D-Lee

/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

nandlalyadav57 avatar Jan 06 '23 06:01 nandlalyadav57

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

ace97 avatar Oct 17 '23 14:10 ace97