File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ if type apt-get >/dev/null ; then
1515 chromium-chromedriver
1616elif type brew > /dev/null ; then
1717 brew list python & > /dev/null || brew install python
18- brew install libxml2 gnu-sed
18+ brew install libxml2 gnu-sed chromedriver
1919 if ! echo $PATH | grep -ql /usr/local/bin ; then
2020 echo ' /usr/local/bin not found in $PATH, please add it.'
2121 fi
Original file line number Diff line number Diff line change 1818from selenium .webdriver .common .by import By
1919from selenium .common .exceptions import WebDriverException
2020
21+ if system .platform .startswith ("linux" ):
22+ chromedriver_path = "/usr/lib/chromium-browser/chromedriver"
23+ elif system .platform .startswith ("darwin" ):
24+ chromedriver_path = "chromedriver"
25+ else :
26+ print "Unsupported Operating System"
27+ sys .exit (3 )
28+
2129class bcolors :
2230 HEADER = '\033 [95m'
2331 OKBLUE = '\033 [94m'
@@ -34,7 +42,7 @@ class bcolors:
3442# First argument is optional, if not specified will search path.
3543
3644try :
37- driver = webdriver .Chrome ('/usr/lib/chromium-browser/chromedriver' , chrome_options = chromeOps )
45+ driver = webdriver .Chrome (chromedriver_path , chrome_options = chromeOps )
3846except WebDriverException as e :
3947 error = e .__str__ ()
4048
@@ -50,9 +58,9 @@ class bcolors:
5058
5159#Page Loaded
5260
53- if driver .current_url .startswith ('httaps ' ):
61+ if driver .current_url .startswith ('https ' ):
5462 print bcolors .OKGREEN + "HTTP to HTTPS redirection successful" + bcolors .ENDC
55- elif (driver .current_url .startswith ('https ' )):
63+ elif (driver .current_url .startswith ('http ' )):
5664 print bcolors .FAIL + "HTTP to HTTPS redirection failed" + bcolors .ENDC
5765 sys .exit (1 )
5866
You can’t perform that action at this time.
0 commit comments