Spaces:
Runtime error
Runtime error
linkedin company page finding created
Browse files- app.py +33 -2
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -1,4 +1,35 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
x = st.slider('Select a value')
|
| 4 |
-
st.write(x, 'squared is', x * x)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from streamlit_option_menu import option_menu
|
| 3 |
+
from googlesearch import search
|
| 4 |
+
import re
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
st.header("LinkedIn Company Search")
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
company = st.text_input("Search a Company here")
|
| 13 |
+
|
| 14 |
+
def get_linkedin_url(company):
|
| 15 |
+
# Init linkedinbio
|
| 16 |
+
linkedinbio = 'No Search Found'
|
| 17 |
+
|
| 18 |
+
# Create query
|
| 19 |
+
query = f"{company}+Linkedin"
|
| 20 |
+
print("Google query: ", query)
|
| 21 |
+
|
| 22 |
+
# Search in Google
|
| 23 |
+
for i in search(query, tld="com", num=10, stop=10, pause=2):
|
| 24 |
+
pattern = "https:\/\/.+.linkedin.com\/company\/.([^?])+"
|
| 25 |
+
result = re.search(pattern, i)
|
| 26 |
+
|
| 27 |
+
# Return value if result is not None
|
| 28 |
+
if result != None:
|
| 29 |
+
linkedinbio = result.group(0).replace(" ", "")
|
| 30 |
+
return linkedinbio
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
linkedin_url = get_linkedin_url(company)
|
| 34 |
+
st.write(linkedin_url)
|
| 35 |
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
-
streamlit
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
google
|