Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile scraping error on get_experiences #179

Open
buliojarros opened this issue Jun 29, 2023 · 2 comments
Open

Profile scraping error on get_experiences #179

buliojarros opened this issue Jun 29, 2023 · 2 comments

Comments

@buliojarros
Copy link

Trying to scrape a profile with the following code:

from linkedin_scraper import Person, actions
from selenium import webdriver

driver = webdriver.Chrome()
email = "xxx@gmail.com"
password = "xxx"
actions.login(driver, email, password)
person = Person("https://www.linkedin.com/in/andre-iguodala-65b48ab5", driver=driver, scrape=False)

person.scrape()

i get the following error

% python3 -m testscrape.py
Traceback (most recent call last):
File "", line 189, in _run_module_as_main
File "", line 112, in _get_module_details
File "/Users/julio/Documents/libri/testscrape.py", line 15, in
person.scrape()
File "/opt/homebrew/lib/python3.11/site-packages/linkedin_scraper/person.py", line 89, in scrape
self.scrape_logged_in(close_on_complete=close_on_complete)
File "/opt/homebrew/lib/python3.11/site-packages/linkedin_scraper/person.py", line 285, in scrape_logged_in
self.get_experiences()
File "/opt/homebrew/lib/python3.11/site-packages/linkedin_scraper/person.py", line 131, in get_experiences
position_title = outer_positions[0].find_element(By.TAG_NAME,"span").find_element(By.TAG_NAME,"span").text
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/julio/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/remote/webelement.py", line 425, in find_element
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/julio/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/remote/webelement.py", line 403, in _execute
return self._parent.execute(command, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/julio/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
self.error_handler.check_response(response)
File "/Users/julio/Library/Python/3.11/lib/python/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"tag name","selector":"span"}
(Session info: chrome=114.0.5735.198)

I've already changed my selenium version to 4.2.0

@yannjor
Copy link

yannjor commented Jul 4, 2023

Duplicate of #173. This pr should fix it #180.

@joeyism
Copy link
Owner

joeyism commented Jul 4, 2023

Pr #180 is merged. Please try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants