File size: 815 Bytes
edd3f4b
7d0975c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
edd3f4b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import streamlit as st
from streamlit_option_menu import option_menu
from googlesearch import search
import re




st.header("LinkedIn Company Search")


company  = st.text_input("Search a Company here")

def get_linkedin_url(company):
    # Init linkedinbio
    linkedinbio = 'No Search Found'
    
    # 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
    

linkedin_url = get_linkedin_url(company)
st.write(linkedin_url)