Closed bevenky closed 2 months ago
+1 same issue here. Searching for fiverr.
Similar issue here :
result = api.search_companies(
keywords="CHEERLY, LET'S PARTY !",
limit=2
)
throws the following error :
[...]
"linkedin.py", line 102, in search
for i in range(len(data["data"]["elements"])):
KeyError: 'data'
I think the error comes from the comma in keywords not being properly encoded
f"/search/blended?{urlencode(default_params, safe='(),')}"
the ,
is not safe for the keywords parameter in this case
+1 bug...
Error happens because you need to transform companyName value with blank which could be "Bla Bla" into "Bla-Bla" You can fixe it by doing:
get_company(companyName.replace(" ", "-"))
Gotta pass in the company's "public id". You can get it from the URL when viewing the company
File "test.py", line 7, in
company = api.get_company('microsoft.com')
File "/Users/linkedinapi_env/lib/pythonX.X/site-packages/linkedin_api/linkedin.py", line 481, in get_company
self.logger.info("request failed: {}".format(data["message"]))
KeyError: 'message'