Spaces:
Sleeping
Sleeping
Update clients.py
Browse files- clients.py +10 -2
clients.py
CHANGED
@@ -11,7 +11,7 @@ import pandas as pd
|
|
11 |
import requests
|
12 |
import os
|
13 |
import pandas as pd
|
14 |
-
|
15 |
def add_https_to_urls(df, column_name):
|
16 |
"""
|
17 |
Adds 'https://' to URLs in the specified column of a DataFrame if they don't already start with a valid protocol.
|
@@ -204,6 +204,7 @@ def UserSpecificClient(email_receiver):
|
|
204 |
df=df[['First Name','Company Name for Emails','Person Linkedin Url','Scrapped Profile','Email']]
|
205 |
else:
|
206 |
df=df[['First Name', 'Last Name', 'Title', 'Website','Company Name for Emails','Person Linkedin Url','Email']]
|
|
|
207 |
|
208 |
# Convert DataFrame to CSV for transmission
|
209 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
@@ -296,8 +297,11 @@ def bothFeaturesFunction(email_receiver):
|
|
296 |
df=df[['First Name','Person Linkedin Url','Scrapped Profile',"Company Name for Emails","scraped_content","Email"]]
|
297 |
else:
|
298 |
df=df[['First Name', 'Last Name', 'Title', 'Person Linkedin Url',"Website","Company Name for Emails","Email"]]
|
|
|
299 |
|
300 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
|
|
|
|
301 |
st.write(df)
|
302 |
# Convert DataFrame to CSV for transmission
|
303 |
csv = df.to_csv(index=False)
|
@@ -383,6 +387,7 @@ def BH_Ngo(email_receiver,calendly_link,sender_name):
|
|
383 |
else:
|
384 |
|
385 |
columns_to_select = ['First Name', 'Title', 'Person Linkedin Url', "Company Name for Emails", "Domain","Website","Email"]
|
|
|
386 |
if 'Last Name' in df.columns:
|
387 |
columns_to_select.insert(1, 'Last Name') # Insert 'Last Name' at the correct position
|
388 |
|
@@ -391,6 +396,8 @@ def BH_Ngo(email_receiver,calendly_link,sender_name):
|
|
391 |
|
392 |
# Convert DataFrame to CSV for transmission
|
393 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
|
|
|
|
394 |
st.write(df)
|
395 |
csv = df.to_csv(index=False)
|
396 |
|
@@ -481,7 +488,8 @@ def BH_industry(email_receiver,calendly_link,sender_name):
|
|
481 |
df = df.drop_duplicates(subset="Website", keep='first')
|
482 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
483 |
|
484 |
-
df = df.dropna().loc[~(df == '').all(axis=1)]
|
|
|
485 |
st.write(df)
|
486 |
# Convert DataFrame to CSV for transmission
|
487 |
csv = df.to_csv(index=False)
|
|
|
11 |
import requests
|
12 |
import os
|
13 |
import pandas as pd
|
14 |
+
|
15 |
def add_https_to_urls(df, column_name):
|
16 |
"""
|
17 |
Adds 'https://' to URLs in the specified column of a DataFrame if they don't already start with a valid protocol.
|
|
|
204 |
df=df[['First Name','Company Name for Emails','Person Linkedin Url','Scrapped Profile','Email']]
|
205 |
else:
|
206 |
df=df[['First Name', 'Last Name', 'Title', 'Website','Company Name for Emails','Person Linkedin Url','Email']]
|
207 |
+
df=add_https_to_urls(df, 'Website')
|
208 |
|
209 |
# Convert DataFrame to CSV for transmission
|
210 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
|
|
297 |
df=df[['First Name','Person Linkedin Url','Scrapped Profile',"Company Name for Emails","scraped_content","Email"]]
|
298 |
else:
|
299 |
df=df[['First Name', 'Last Name', 'Title', 'Person Linkedin Url',"Website","Company Name for Emails","Email"]]
|
300 |
+
df=add_https_to_urls(df, 'Website')
|
301 |
|
302 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
303 |
+
try:
|
304 |
+
df=add_https_to_urls(df, 'Website')
|
305 |
st.write(df)
|
306 |
# Convert DataFrame to CSV for transmission
|
307 |
csv = df.to_csv(index=False)
|
|
|
387 |
else:
|
388 |
|
389 |
columns_to_select = ['First Name', 'Title', 'Person Linkedin Url', "Company Name for Emails", "Domain","Website","Email"]
|
390 |
+
df=add_https_to_urls(df, 'Website')
|
391 |
if 'Last Name' in df.columns:
|
392 |
columns_to_select.insert(1, 'Last Name') # Insert 'Last Name' at the correct position
|
393 |
|
|
|
396 |
|
397 |
# Convert DataFrame to CSV for transmission
|
398 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
399 |
+
try:
|
400 |
+
df=add_https_to_urls(df, 'Website')
|
401 |
st.write(df)
|
402 |
csv = df.to_csv(index=False)
|
403 |
|
|
|
488 |
df = df.drop_duplicates(subset="Website", keep='first')
|
489 |
df = df.dropna().loc[~(df == '').all(axis=1)]
|
490 |
|
491 |
+
df = df.dropna().loc[~(df == '').all(axis=1)]
|
492 |
+
df=add_https_to_urls(df, 'Website')
|
493 |
st.write(df)
|
494 |
# Convert DataFrame to CSV for transmission
|
495 |
csv = df.to_csv(index=False)
|