cullenwatson/StaffSpy

Exception in parse_emp when topProfileData has no element.

Closed this issue · 1 comments

'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "C:\Users\2btec\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\staffspy\linkedin\experiences.py", line 50, in parse_experiences
    not entity["subComponents"]
        ~~~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "C:\Users\2btec\AppData\Local\Programs\PyCharm Professional\plugins\python\helpers\pydev\pydevd.py", line 1551, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\2btec\AppData\Local\Programs\PyCharm Professional\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:\repo\LinkedIn_Scraper\main.py", line 30, in <module>
    staff = scrape_openai_staff()
            ^^^^^^^^^^^^^^^^^^^^^
  File "C:\repo\LinkedIn_Scraper\main.py", line 12, in scrape_openai_staff
    staff2 = scrape_staff(
             ^^^^^^^^^^^^^
  File "C:\Users\2btec\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\staffspy\__init__.py", line 25, in scrape_staff
    staff = li.scrape_staff(
            ^^^^^^^^^^^^^^^^
  File "C:\Users\2btec\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\staffspy\linkedin\linkedin.py", line 219, in scrape_staff

need to fix to handle empty cases.