Skip to content

Commit 8aeba85

Browse files
committed
Added Credentials Validator
1 parent e691228 commit 8aeba85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Linkedin_Connections_Scrapper/script.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from selenium import webdriver
66
import pandas as pd
77
import time
8+
import sys
89
import re
910

1011
pattern_name = "\\n(.+)\\n" # Used to extract names
@@ -49,6 +50,11 @@ def login(email, password):
4950
# Locate Submit button and click it
5051
submit = driver.find_element_by_class_name("sign-in-form__submit-button")
5152
submit.click()
53+
# Check credentials output
54+
if driver.title != "LinkedIn":
55+
print("Provided E-mail/Password is wrong!")
56+
driver.quit()
57+
sys.exit()
5258
# Return session
5359
return driver
5460

0 commit comments

Comments
 (0)