tomquirk / linkedin-api

👨‍💼Linkedin API for Python
MIT License
1.71k stars 401 forks source link

Is get_profile not working? #382

Open Dr4k3z opened 2 months ago

Dr4k3z commented 2 months ago

This morning the function get_profile threw the following error: "requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)"

Last night the code was working correctly. Is there something i'm doing wrong?

ignacio-ferreira-dev commented 2 months ago

Same happened to me, maybe linkedin changed something

ignacio-ferreira-dev commented 2 months ago

Update: I checked the error I am getting and I am getting: <Response [999]> Request denied

Which means the following: It seems that LinkedIn blocks "bad" request with this 999 non-standard Status Code (they should better respond with 400 Bad Request and an explanation). Some reports that it comes from the HEAD method (which is similar to GET but does not request the body), or a missing header( Accept-Encoding), or the User-Agent header, or the source IP (from Heroku).

Hakurei-git commented 2 months ago

Update: I checked the error I am getting and I am getting: <Response [999]> Request denied

Which means the following: It seems that LinkedIn blocks "bad" request with this 999 non-standard Status Code (they should better respond with 400 Bad Request and an explanation). Some reports that it comes from the HEAD method (which is similar to GET but does not request the body), or a missing header( Accept-Encoding), or the User-Agent header, or the source IP (from Heroku).

If the response 999 is displayed, the cookie is invalid. You can delete the file of the cookie

j-j-gajjar commented 2 months ago

@Hakurei-git Can you please tell me how can I clear the cookies and where is the location

Hakurei-git commented 2 months ago

@Hakurei-git Can you please tell me how can I clear the cookies and where is the location

In the linkedin_api directory there is a setting.py file where you can print the COOKIE_PATH and change it to where you want it to be

ignacio-ferreira-dev commented 2 months ago

It worked for me, just cleaned the cookies and it worked, thanks!