-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (28 loc) · 898 Bytes
/
main.py
File metadata and controls
29 lines (28 loc) · 898 Bytes
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
import time
import random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from linkedin import Linkedin
from config import Config
from urllib3.exceptions import ProtocolError
from selenium.common.exceptions import NoSuchWindowException, TimeoutException
from exceptions import RequiredException, FinishException
import pyotp
config = Config()
linkedin = Linkedin(config=config)
try:
linkedin.run()
except TimeoutException:
config.getLogger().error(
"Element wasn't where it was supposted to be! Probably bot detection")
exit(2)
except RequiredException as e:
config.getLogger().error(e)
exit(1)
except FinishException as e:
config.getLogger().warning(e)
config.printReport()
except (KeyboardInterrupt, ProtocolError, NoSuchWindowException):
config.getLogger().warning("Search Interupted")
config.printReport()
exit(3)