linkedin_scraper icon indicating copy to clipboard operation
linkedin_scraper copied to clipboard

I started a new repo and got the following error

Open eleijonmarck opened this issue 2 years ago • 10 comments

AttributeError: 'WebDriver' object has no attribute 'find_elements_by_class_name'

should be replaced by:

driver.find_element("name", "q")

according to https://stackoverflow.com/a/72773269/3767229

eleijonmarck avatar Apr 16 '23 19:04 eleijonmarck

I quess you downloaded a previous version of the module try using pip install linkedin-scraper==2.11.0

lusifer021 avatar Apr 18 '23 16:04 lusifer021

I get the same error with linkedin-scraper==2.11.0

ternaus avatar Apr 18 '23 20:04 ternaus

@ternaus Can you attach a screenshot of which function you are using?

lusifer021 avatar Apr 18 '23 20:04 lusifer021

selenium==4.8.3
linkedin-scraper==2.11.0
from linkedin_scraper import Person, actions
from selenium import webdriver
driver = webdriver.Chrome()

email = <EMAIL>
password = <PASSWORD>

actions.login(driver, email, password) # if email and password isnt given, it'll prompt in terminal
person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)

print(person.name)

=>

Traceback (most recent call last):
  File "/mnt/evo850/workspace/SalesBrain.tech/scripts/get_person.py", line 9, in <module>
    person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 63, in __init__
    self.scrape(close_on_complete)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 88, in scrape
    self.scrape_logged_in(close_on_complete=close_on_complete)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 261, in scrape_logged_in
    self.get_name_and_location()
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 235, in get_name_and_location
    top_panels = self.driver.find_elements_by_class_name("pv-text-details__left-panel")
AttributeError: 'WebDriver' object has no attribute 'find_elements_by_class_name'

ternaus avatar Apr 19 '23 03:04 ternaus

selenium==4.8.3
linkedin-scraper==2.11.0
from linkedin_scraper import Person, actions
from selenium import webdriver
driver = webdriver.Chrome()

email = <EMAIL>
password = <PASSWORD>

actions.login(driver, email, password) # if email and password isnt given, it'll prompt in terminal
person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)

print(person.name)

=>

Traceback (most recent call last):
  File "/mnt/evo850/workspace/SalesBrain.tech/scripts/get_person.py", line 9, in <module>
    person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 63, in __init__
    self.scrape(close_on_complete)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 88, in scrape
    self.scrape_logged_in(close_on_complete=close_on_complete)
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 261, in scrape_logged_in
    self.get_name_and_location()
  File "/home/vladimir/anaconda3/envs/salesbrain.tech/lib/python3.10/site-packages/linkedin_scraper/person.py", line 235, in get_name_and_location
    top_panels = self.driver.find_elements_by_class_name("pv-text-details__left-panel")
AttributeError: 'WebDriver' object has no attribute 'find_elements_by_class_name'

#158 this PR will solve this issue @ternaus

lusifer021 avatar Apr 19 '23 05:04 lusifer021

@lusifer021 Let's merge it? :)

ternaus avatar Apr 21 '23 15:04 ternaus

Yes, but I don't have access.

lusifer021 avatar Apr 21 '23 16:04 lusifer021

Also have this issue.

mattsunsjf avatar Apr 27 '23 06:04 mattsunsjf

How to solve it?

javaCR7 avatar May 04 '23 13:05 javaCR7

use this PR #158 @javaCR7 @mattsunsjf

lusifer021 avatar May 04 '23 17:05 lusifer021