summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-02-01 02:00:24 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-02-01 02:00:24 +0530
commit788b9d2fca6b89b71ea4f82e2fcb70b0d2322b94 (patch)
tree128e5392bb13da1a131d71f8763b651846b41374
parentc3616fad8e3b72e226b6f241c09c5833b7041955 (diff)
README + adding other successful login page button
-rw-r--r--README.md9
-rw-r--r--auto-login.py6
2 files changed, 9 insertions, 6 deletions
diff --git a/README.md b/README.md
index 715e0e6..cd92cc2 100644
--- a/README.md
+++ b/README.md
@@ -53,12 +53,13 @@ And execute it from anywhere as:
```
## Intentions:
-I originally wished to create a shellscript to log into my College wifi-portal just using the terminal.
+I originally wished to create a shellscript to log into my College wifi-portal just using the terminal (Since I don't use a full-fledged desktop environment that would notify me to log in to a captive-portal).
I later set up [this makeshift script](https://github.com/justsaumit/.dotfiles/blob/main/.scripts/wifi-captive-login)
which just finds out the gateway IP and uses st's -e flag that allows st to open the captive-portal in a webbrowser on a new temporary terminal window.
-Issue was I still had to type in my login credentials _everytime_ :/
-With this it is the same except I get to automate it using [gnu pass](https://www.passwordstore.org/)
-and that using XPath(XML Path) to find elements is really convenient.
+The issue was I still had to type in my login credentials _everytime_ :/
+With this, it is the same except I get to automate it using [gnu pass](https://www.passwordstore.org/) (my choice of a simple, secure and encrypted password manager)
+and that using XPath(XML Path) to find elements is pretty convenient.
+
## Future additions:
- [x] Update the script upon reaching college as the Xpath values would differ. (done in [382c298](https://github.com/justsaumit/auto-captive-portal-login/commit/e24805733d5689eba28770172cd1bd99dedf247d) & [e248057](https://github.com/justsaumit/auto-captive-portal-login/commit/e24805733d5689eba28770172cd1bd99dedf247d) )
diff --git a/auto-login.py b/auto-login.py
index 2475a1f..24b1c3a 100644
--- a/auto-login.py
+++ b/auto-login.py
@@ -22,7 +22,9 @@ driver.find_element(by=By.XPATH,value="//*[@id='cppassword']").send_keys(w_pass)
driver.find_element(by=By.XPATH,value="//*[@id='btnLogin']").click()
time.sleep(9)
if(driver.find_element(by=By.XPATH,value="//*[@id='btnLogout']").is_displayed()):
- print("Logged in successfully!")
+ print("Logged in successfully!")
+elif(driver.find_element(by=By.XPATH,value="/html/body/table/tbody/tr/td/form/input").is_displayed()):
+ print("Logged in successfully!")
else:
- print("Login failed")
+ print("Login failed")
driver.close()