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

UnboundLocalError: cannot access local variable 'work_times' where it is not associated with a value #185

Open
maxnau89 opened this issue Jul 18, 2023 · 4 comments

Comments

@maxnau89
Copy link

Hello all,

this seems to be an issue within the person.py:

Traceback (most recent call last):
File "/Users/abcd/Documents/GitHub/Linkedin-Notion-Transfer/linkedin3.py", line 155, in
person = Person(linkedin_url, about=[], experiences=[], educations=[], driver=driver, close_on_complete=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/linkedin_scraper/person.py", line 64, in init
self.scrape(close_on_complete)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/linkedin_scraper/person.py", line 89, in scrape
self.scrape_logged_in(close_on_complete=close_on_complete)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/linkedin_scraper/person.py", line 285, in scrape_logged_in
self.get_experiences()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/linkedin_scraper/person.py", line 147, in get_experiences
times = work_times.split("·")[0].strip() if work_times else ""
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'work_times' where it is not associated with a value

@georgemccrae
Copy link

hey i have this error too! did you manage to find a solution? thanks

@itsa-mee-mario
Copy link

any updates on this?

@Kiru6ik
Copy link

Kiru6ik commented Aug 16, 2023

Hi, tried to solve it but couldnt find any solution. For now I am just use try/except on the part with worktimes because it doesnt matter in my use case. @joeyism any ideas why it is happening? Happens to some accounts, some working fine. I think this one should catch this error

@laols574
Copy link

you can also just add the line work_times, company, location, position_title = "", "","","" above line 130

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

5 participants