<jupyter_start><jupyter_text>Google Search - Get LinkedIn company url from name **Tags:** googlesearch snippet operations url **Author:** [<NAME>](https://www.linkedin.com/in/ACoAABCNSioBW3YZHc2lBHVG0E_TXYWitQkmwog/)  Input  Import library<jupyter_code>try:
    from googlesearch import search
except:
    !pip install google
    from googlesearch import search
import re<jupyter_output><empty_output><jupyter_text>Variables<jupyter_code>company = "Tesla"<jupyter_output><empty_output><jupyter_text>Model  Get LinkedIn url<jupyter_code>def get_linkedin_url(company):
    # Init linkedinbio
    linkedinbio = None
    
    # Create query
    query = f"{company}+Linkedin"
    print("Google query: ", query)
    
    # Search in Google
    for i in search(query, tld="com", num=10, stop=10, pause=2):
        pattern = "https:\/\/.+.linkedin.com\/company\/.([^?])+"
        result = re.search(pattern, i)

        # Return value if result is not None
        if result != None:
            linkedinbio = result.group(0).replace(" ", "")
            return linkedinbio
    return linkedinbio

linkedin_url = get_linkedin_url(company)<jupyter_output><empty_output><jupyter_text>Output  Display the result of the search<jupyter_code>linkedin_url<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1141732283464567, 'fraction_numerical': 0.007086614173228346, 'mean_word_length': 4.230452674897119, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '146576', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 437, 'n_tokens_neox': 422, 'n_words': 88, 'path': 'Google Search/Google_Search_Get_LinkedIn_company_url_from_name.ipynb', 'repo_name': 'krajai/testt', 'size': '1279'}