linkedin-api
linkedin-api copied to clipboard
Get company using urn
Hello,
We cannot search a company using the company url ID.
Current function use company name and it's bugged.
J
@tomquirk I have written a small function for it:
COMPANY_URL_INITIAL = "https://www.linkedin.com/company/"
def get_company_name(input_string):
"""Function to extract company urn or urn id
:param input_string: string which could be company url or urn or urn id
:return: company urn or company urn id
"""
if COMPANY_URL_INITIAL in input_string:
name = input_string.rsplit(COMPANY_URL_INITIAL)
name = name[1].replace("/", "")
return name
return input_string
Doesn't help. get_company() is bugged because it relies on company name but it's not accurate.
using urn_id will debug https://github.com/tomquirk/linkedin-api/issues/75 issue