joeyism / linkedin_scraper

A library that scrapes Linkedin for user data
GNU General Public License v3.0
2.08k stars 575 forks source link

Message: no such element: Unable to locate element: {"method":"css selector","selector":".top-card-layout__title"} #139

Closed tejush1998 closed 1 year ago

tejush1998 commented 1 year ago

Hey everyone, I'm getting this error while trying to login into linkedin, I have double checked email and password but still not working


you are not logged in!
please verify the capcha then press any key to continue...
Traceback (most recent call last):
  File "/Users/mac/Desktop/linkedin.py", line 8, in <module>
    person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 62, in __init__
    self.scrape(close_on_complete)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 91, in scrape
    self.scrape_not_logged_in(close_on_complete=close_on_complete)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 327, in scrape_not_logged_in
    self.name = driver.find_element_by_class_name(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 766, in find_element_by_class_name
    return self.find_element(by=By.CLASS_NAME, value=name)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1251, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".top-card-layout__title"}
  (Session info: chrome=107.0.5304.110)```
joeyism commented 1 year ago

So it works now?

rafikg commented 1 year ago

@joeyism Same error here and it does not work. Can you please specify which version of selenium are you using ?

ayush431 commented 1 year ago

Hey everyone, I'm getting this error while trying to login into linkedin, I have double checked email and password but still not working

you are not logged in!
please verify the capcha then press any key to continue...
Traceback (most recent call last):
  File "/Users/mac/Desktop/linkedin.py", line 8, in <module>
    person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 62, in __init__
    self.scrape(close_on_complete)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 91, in scrape
    self.scrape_not_logged_in(close_on_complete=close_on_complete)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/linkedin_scraper/person.py", line 327, in scrape_not_logged_in
    self.name = driver.find_element_by_class_name(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 766, in find_element_by_class_name
    return self.find_element(by=By.CLASS_NAME, value=name)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1251, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 430, in execute
    self.error_handler.check_response(response)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".top-card-layout__title"}
  (Session info: chrome=107.0.5304.110)```

still struggling into this any solution??