linkedin_scraper icon indicating copy to clipboard operation
linkedin_scraper copied to clipboard

Fixed handling for when a person has multiple positions under a company

Open myrontuttle opened this issue 2 years ago • 5 comments

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.

myrontuttle avatar Apr 05 '23 22:04 myrontuttle

Hi, can you please resolve the merge conficts, then I'll merge this in? Thanks

joeyism avatar May 10 '23 09:05 joeyism

Please merge this asap, I'm getting the same issue.

iadnanmalik avatar May 10 '23 18:05 iadnanmalik

Yep, conflicts resolved.

myrontuttle avatar May 11 '23 00:05 myrontuttle

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 avatar Jun 21 '23 23:06 shanedoolane

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

joeyism avatar Jun 25 '23 11:06 joeyism