title: Python script to click Enable / disable WiFi
body: <p>I want to create a simple python script, which will log into my routers website, turn off the wifi and then apply the changes and also do the oposite (turn On wifi and apply the changes), unfortunatelly my knowledge of html tagging and python is not good enough, so please help me :)</p>
  
  <p>Here is what I have created so far:</p>
  
  <pre><code>from bs4 import BeautifulSoup as soup
  from urllib.request import urlopen as uReq
  import requests
  
  my_url = 'http://router/WLG_adv.htm'
  response = requests.get(my_url, auth=requests.auth.HTTPBasicAuth('My_username', 'My_password'))
  c = response.content
  uClient = uReq(my_url)
  soup = BeautifulSoup(c)
  rows = soup.findAll('tr')[4::5]
  soup.find("button", "button-apply")
  </code></pre>
  
  <p>...thanks to that I am able to log into a proper page with credentials and get right code to manipulate with:</p>
  
  <p>Here is "wifi enable check box part" ( I belive it's check_wifi_sche() )</p>
  
  <pre><code>[&lt;tr&gt;
  &lt;td colspan="2"&gt;
  &lt;input checked="" name="enable_ap" onclick="check_wifi_sche()" type="checkbox" value="enable_ap"/&gt; Enable Wireless Router Radio &lt;/td&gt;&lt;/tr&gt;,   &lt;tr&gt;
  &lt;td colspan="2"&gt;
  &lt;div id="wifi_sche_div1"&gt;
  &lt;input name="wifi_onoff" type="checkbox" value="wifi_onoff"/&gt; Turn off wireless signal by schedule 
  &lt;/div&gt;
  &lt;/td&gt;
  &lt;/tr&gt;, &lt;tr&gt;&lt;td colspan="2" height="12"&gt;&lt;div style="background-image:url('liteblue.gif');width:100%"&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;, &lt;tr&gt;
  &lt;td colspan="2"&gt;
  &lt;input checked="" name="wsc_config" type="checkbox"/&gt;
  &lt;font&gt;  Keep Existing Wireless Settings  &lt;/font&gt;
  &lt;/td&gt;
  &lt;/tr&gt;]
  </code></pre>
  
  <p>And here is "Apply button part":</p>
  
  <pre><code>&gt;&gt;&gt; soup.find("button", "button-apply")
  
  &lt;button class="button-apply" name="Apply" onclick="buttonClick(this,'Apply');return checkData();" type="submit" value="Apply"&gt; &lt;span class="roundleft_apply"&gt;Apply &lt;span class="apply-icon"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="roundright_apply"&gt;   &lt;/span&gt;&lt;/button&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>