Discussion stats
  • 1 reply
  • 1259 views
  • 2 kudos
  • 2 in conversation
Announcements

Reply
Highlighted
Initiate

On/Off wifi on Netgear router via HTTP request (Python)

I am writing a small python script that should allow to enable/disable the wifi signal of my Netgear router by submitting HTTP requests (selenium is not an option).

 

>>> import requests   
>>> url = 'http://192.168.1.1/wlg_adv.cgi'

>>> payload={'wifi_5g_state': 'enable'}
>>> r = requests.post(url,data=payload,auth=('admin','notmypassword'))
>>> print(r.text)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<META name="description" content="WNDR3400v3">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Pragma" content="no-cache">
<META HTTP-equiv="Cache-Control" content="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">

<title>NETGEAR   Genie</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="effect.js"></script>
<link rel="stylesheet" href="CDL.css">
</head>
<body>
<table BORDER="0" CELLSPACING="0" CELLPADDING="5" width="99%">
<tr style="height:10px">
    <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
</tr>
<tr><td>&nbsp;</td><td class="textRow centerTd"><p>Sorry,your timestamp is expired.<br> Please click the menu to re-enter the page.</p></td><td>&nbsp;</td></tr>  
<tr style="height:10px">
    <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
</tr>
<tr style="height:10px">
    <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
</tr>
</table>
</body>
</html>
Message 1 of 2
Highlighted
Guru

Re: On/Off wifi on Netgear router via HTTP request (Python)

Thx for sharing.

 

This area is for readynas, not routers.  I'll move your post to the router area.

Message 2 of 2