

readable only by user ( chmod 400 ~/.netrc).Netgear Genie Setup: Install Extender Easily
#NETGEAR GENIE SIGN IN PASSWORD#
If one runs wget then the password is viewable to all on your machine via the process list ( ps a).

UPDATE: I have a ~/.netrc file with a line in it like: machine my_router_address login someloginname password somepasswordīefore wget downloads from the router, it retrieves the login info from this file. Thus, the traffic.htm file can be easily captured and parsed with the scripting language of your choice. I can, for example, capture this page with wget: wget Using a text editor on the resulting traffic.htm file, I see that the traffic data is available in a lengthy block that starts: var traffic_today_time="1486:37" Using FireFox, I went to the traffic page and then used "This Frame -> Show only this frame" to discover that the URL for the traffic page on my router is: After finding this URL, no web browswer and no javascript is needed. The first step is finding the correct URL. Yours may differ but I have found that my scripts can get all the info they need without javascript. The web interface for my Netgear router (WNDR3700) is also filled with javascript. I wouldn't have gotten to this answer without them. Thank you, everyone, for your suggestions. The nice thing about this is it has no external dependencies like selenium, wget or other libraries that needs to be installed. I can then take this and parse the values out of it. This prints out the entire traffic meter webpage from my router, with its proper values loaded. Opener = urllib2.build_opener(authhandler) Passman.add_password(None, host, user, pwd)Īuthhandler = urllib2.HTTPBasicAuthHandler(passman) Passman = urllib2.HTTPPasswordMgrWithDefaultRealm() Url = ' + host + '/traffic_meter_2nd.htm' This is the final script I ended up using: import urllib2 My problem was I was trying to make it too complicated. I ended up going back to the original reboot_router.py script I had attempted to modify unsuccessfully the first time. However I didn't like the fact that wget saved the result to a file, which I would then have to open and parse.

#NETGEAR GENIE SIGN IN DOWNLOAD#
I did try John1024's suggestion and was able to download the proper webpage from the router using wget. Okay, I found the solution and it was way easier than I thought. This fixes the web browser being loaded, but it failed the authentication. Url = closing(webdriver.Remote(desired_capabilities = )) as driver: Okay, I tried sircapsalot's suggestion and modified the script to this: from selenium import webdriver So, my question is, what is the best way to accomplish what I want without having it launch a visible web browser window? t_preference('-userpass-length', 255)ĭriver = webdriver.Firefox(firefox_profile=profile) Here is the code: from selenium import webdriver Second, it skips the stuff I put in to pass the HTTP authentication and pops up the login window anyway. First, it actually opens the browser window, which is not what I want. I tried selenium and have run into two problems. This type of thing is described in many posts about web scraping and people suggested using selenium. I originally tried modified a script that would reboot the router (found here ) but it just serves up the raw html and I need it after the onload javascript functions have run. I'm using python to try to access the router's web page, but I've run into some snags. It's easy enough to login to it and click on the link, but ideally I would like a little app that sits down in the system tray (windows) that I can check whenever I want to see what my network traffic is. What I am trying to do is access the traffic meter data on my local netgear router.
