linkedin_scraper
linkedin_scraper copied to clipboard
Fixed handling for when a person has multiple positions under a company
I was getting an error that the work_time variable wasn't set when trying to scrape my own experiences: https://www.linkedin.com/in/myrongt/details/experience/ This was because I have had multiple positions with the same company. This change fixes that issue.
Hi, can you please resolve the merge conficts, then I'll merge this in? Thanks
Please merge this asap, I'm getting the same issue.
Yep, conflicts resolved.
this pr doesn't work anymore
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.133); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
venv/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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
this pr doesn't work anymore
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.133); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
venv/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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@shanedoolane if you fork this, fix it, and submit a PR, I'll merge it in and deploy