Skip to content

Commit

Permalink
feat: added show wifi pass to cisco-dpc3928s
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianoliveira committed Nov 28, 2015
1 parent d6a984d commit 0bf285a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions croutera/models/cisco/dpc3928s.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@

from croutera.models.base import Router
import requests
from bs4 import BeautifulSoup


class CiscoDPC3928S(Router):

HOST = 'http://192.168.0.1'

LOGIN_URI = '/goform/Docsis_system'
RESTART_URI = '/goform/Devicerestart'
WIFI_PASS_URI = '/Quick_setup.asp'

login_data = {
'username_login': '',
Expand Down Expand Up @@ -37,3 +40,11 @@ def restart(self):
res = self.session.post(self.HOST + self.RESTART_URI,
data = self.restart_data)
return res.ok

def wifi_pass(self):
url = self.HOST + self.WIFI_PASS_URI
response = self.session.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
return soup.find('input', {'id':'wl5g_wpa_psk_key'}).get('value')


0 comments on commit 0bf285a

Please sign in to comment.