Last active
April 6, 2020 13:41
-
-
Save TheNilesh/69acad71e08beece00858a00678382ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir615_url = 'http://192.168.1.1' | |
form_url = 'url to the google form which has only two text fields one for ssid and another for wpa key' | |
print('logging in to router') | |
requests.post(dir615_url + '/login.cgi',data={'username':username, 'password':password, 'submit.htm?login.htm':'Send'}) | |
print('getting pass page') | |
response = requests.get(dir615_url + '/wlan_basic.htm') | |
soup = BeautifulSoup(response.content, 'html.parser') | |
input_passphrase = soup.find('input', {'name':'pskValue'}) | |
passphrase = input_passphrase['value'] | |
input_ssid = soup.find('input', {'name':'ssid'}) | |
ssid = input_ssid['value'] | |
fields_to_submit = [ssid, passphrase] | |
print(fields_to_submit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment