Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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/
share|improve this answer
    
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_usern‌​ame=" 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_userna‌​me=0011AA88BB33" https://apps.nwtel.ca/cable_usage/login.jsp) –  matt wilkie Jul 16 '11 at 6:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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