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

KeyError: 'paging' #5

Open
azizmhmmdf opened this issue Jan 18, 2024 · 2 comments
Open

KeyError: 'paging' #5

azizmhmmdf opened this issue Jan 18, 2024 · 2 comments

Comments

@azizmhmmdf
Copy link

azizmhmmdf commented Jan 18, 2024

try:
r = requests.get(url, cookies=cookies, headers=headers, timeout=60)
except Exception:
exit()

try:
    content = json.loads(r.text)
except:
    return(r.text)

print(content) -> {'status': 404}   

Traceback (most recent call last):
File "/home/be-azizmuhammadf/Documents/E-bdesk/Project/2024/linkedin/main.py", line 129, in
main()
File "/home/be-azizmuhammadf/Documents/E-bdesk/Project/2024/linkedin/main.py", line 122, in main
results = getProfileFromName(search_string, config["JSESSIONID"],config["li_at"])
File "/home/be-azizmuhammadf/Documents/E-bdesk/Project/2024/linkedin/main.py", line 48, in getProfileFromName
data_total = content['paging']['total']
KeyError: 'paging'

@azizmhmmdf azizmhmmdf changed the title {'status': 404} KeyError: 'paging' Jan 18, 2024
@SuperSayf
Copy link

I am getting the same error

Traceback (most recent call last):
  File "/Users/***/Downloads/nqntnqnqmb-master/nqntnqnqmb.py", line 67, in <module>
    result= getProfileFromName(profile,config["JSESSIONID"],config["li_at"])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/***/Downloads/nqntnqnqmb-master/nqntnqnqmb/core.py", line 60, in getProfileFromName
    data_total = content['paging']['total']
                 ~~~~~~~^^^^^^^^^^
KeyError: 'paging'

@JackBlair87
Copy link

I don't think this library works after LinkedIn updated their CSS recently. Here was my approach: https://medium.com/@jackblair87/writing-a-live-follower-count-python-program-for-my-website-5e34631582d3

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