linkedin-api
linkedin-api copied to clipboard
Exception in get company method
File "test.py", line 7, in
+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(" ", "-"))