huang zuxing blog @ home the quieter you become, the more you are able to hear.

9Jan/12Off

Auto login a web interface and auto fill form

Very sad to say, in our department, a boss comes out an "idea" to force us to fill a form every week, in which you need to tell him how you spend your time. If too late to fill the form, a warning letter would come from VP!

After a few weeks, this is very annoyed as we keep filling the same thing every time.

We need an auto script to finish this task. below is a simple method.

Use lynx !!

1. record down what you need to do: login, fill form, save, logout

lynx -accept_all_cookies -cmd_log ./record_info http://www.xxresourcexxx.com.

2. auto repeat what every you type and what ever info you fill in, create autofill.sh

#!/bin/bash
lynx -accept_all_cookies -cmd_script ./record_info http://www.xxresoucexxx.com

To verify the result, you could manually login and check the form info.

Put command into crontab, let it do the same task for you every friday 1am.

1 1 * * 5 /xxx/xxx/autofill.sh

As you type in your password during login, please keep file ./record_info into a "safe" location.

Tagged as: , No Comments