linkedin-api icon indicating copy to clipboard operation
linkedin-api copied to clipboard

search is no longer working

Open markwartV opened this issue 1 year ago • 7 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.

markwartV avatar Sep 15 '23 09:09 markwartV

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

C-Nubela avatar Sep 15 '23 19:09 C-Nubela

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

aethrvmn avatar Sep 16 '23 11:09 aethrvmn

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

diogobarreto avatar Oct 17 '23 15:10 diogobarreto

@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 avatar Oct 19 '23 06:10 markwartV

@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

tomquirk avatar Mar 15 '24 04:03 tomquirk

nope, it still doesn't work

Orfeous avatar Mar 24 '24 12:03 Orfeous

@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.

markwartV avatar Mar 25 '24 09:03 markwartV