My ISP has a web form I can check to see what my current bandwidth usage and quota is. It's drudge work to everyday load that page, enter MAC address, submit, wait for results, scroll down to read results. How can I automate this?

I know a bit about html, a little about python, nothing about javascript, ajax etc. and use Windows 7.

[update] - the actual page is https://apps.nwtel.ca/cable_usage/login.jsp, the previous one is a frame page.


In principle you can use command-line tools cURL or wget to do this. Something like the following using curl

curl -c cookie.txt -o file.html -d "option1=value1&option2&value2" http://www.foobar.com/someformpage/
  • I don't get the form results using that, just the page itself. Here's my command line (with a made up MAC address): curl --insecure -c cookie.txt -o file.html -d "&j_target_url=secured/index.jsp&MAC=00:11:aa:88:bb:33&j_password=123456&j_username=" https://apps.nwtel.ca/cable_usage/login.jsp – matt wilkie Jul 15 '11 at 8:10
  • How about try dropping the first & and actually assigning a value to j_username in you -d option? – Computist Jul 15 '11 at 19:09
  • in the html source code for the form j_username is blank, however I noticed today the page also includes some javascript to (I think) strip the colons etc. from the MAC address and submit that as the value for j_username in all uppercase. I tried doing that manually but no change in results. (curl --insecure -c cookie.txt -o file.html -d "j_target_url=secured/index.jsp&MAC=00:11:aa:88:bb:33&j_password=123456&j_username=0011AA88BB33" https://apps.nwtel.ca/cable_usage/login.jsp) – matt wilkie Jul 16 '11 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.