joeyism / linkedin_scraper

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

I started a new repo and got the following error #157

Open eleijonmarck opened 1 year ago

eleijonmarck commented 1 year ago

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

lusifer021 commented 1 year ago

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

ternaus commented 1 year ago

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

lusifer021 commented 1 year ago

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

ternaus commented 1 year ago
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'
lusifer021 commented 1 year ago
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

ternaus commented 1 year ago

@lusifer021 Let's merge it? :)

lusifer021 commented 1 year ago

Yes, but I don't have access.

mattsunsjf commented 1 year ago

Also have this issue.

javaCR7 commented 1 year ago

How to solve it?

lusifer021 commented 1 year ago

use this PR #158 @javaCR7 @mattsunsjf