tomquirk / linkedin-api

👨‍💼Linkedin API for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

search is no longer working

markwartV opened this issue · comments

Hello,
first of all, thank you very much for the excellent program. Until a few days ago, it was working perfectly.
Unfortunately, since the day before yesterday, the search function has stopped working. Initially, I received the following error message:

File "/Users/myUsername/code/linkedin-api/test.py", line 8, in
search_persons = api.search_people(keyword_title=jobtitle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myUsername/code/linkedin-api/linkedin_api/linkedin.py", line 414, in search_people
data = self.search(params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/myUsername/code/linkedin-api/linkedin_api/linkedin.py", line 244, in search
data_clusters = data.get("data", []).get("searchDashClustersByAll", [])

In response to this, I made the requested change from (line 244, linkedin.py)
data_clusters = data.get("data", []).get("searchDashClustersByAll", [])
to
data_clusters = data.get("data", {}).get("searchDashClustersByAll", []),
and now, regrettably, I am no longer getting any results for searches that were previously functioning very well.

Hey there @markwartV

I'm a representative from Proxycurl, a proud sponsor of the linkedin-api project on GitHub.

Regarding the issue you've encountered with the search function, I've taken a closer look at the search method in the linkedin.py file. I noticed the line you mentioned:

data_clusters = data.get("data", []).get("searchDashClustersByAll", [])

You've changed it to:

data_clusters = data.get("data", {}).get("searchDashClustersByAll", [])

That changes the default value for the 'get' method from a list to a dictionary.

The subsequent call to get("searchDashClustersByAll", []) might be causing the issue.

But that doesn't answer why the search function would just randomly stop working though.

You may consider throwing everything out and starting from scratch and seeing if the error still persists.

Also, if you're exploring more robust or alternative solutions for LinkedIn data extraction, do consider Proxycurl.

We offer comprehensive data-driven solutions that might align with your needs.

Best wishes,
Colton
Proxycurl

I get the same issue without changes, the error doesn't appear either

@markwartV any updates/work around regarding this? all help is much appreciated.

@markwartV any updates/work around regarding this? all help is much appreciated.

Sorry, I haven't been able to find a solution yet. I've been trying with alternatives, but not with much success. Until now, I wasn't even sure if others had the same issue, based on the reactions I've seen here.

@markwartV @diogobarreto @baledick @C-Nubela hey all

I've pushed a potential fix to version 2.1.1 - could you give it a try and let me know how you go?

pip install linkedin-api==2.1.1

nope, it still doesn't work

@markwartV @diogobarreto @baledick @C-Nubela hey all

I've pushed a potential fix to version 2.1.1 - could you give it a try and let me know how you go?

pip install linkedin-api==2.1.1

Hi @tomquirk,
First of all, thanks for taking care of this. Because of your changes, the API partially works again for me, but the error still occurs occasionally, unfortunately, I can't pinpoint what's causing it. Anyway, I catch the error using “try-catch” in Python and can work with it relatively well, I would estimate that the error still occurs in about 60 percent of my searches. That's a huge relief for me since it was 100 percent before.