Using authentication proxy in web browser

Hello fellas! I have quite a tough AppleScript / Automator problem here and I was wondering if anybody could solve it (or at least say if it is even scriptable…)

My school uses authentication proxy server for granting access to several commercial services (databases etc.) when user is outside the school network. However, the way how system works is annoyingly slow in everyday use.

The whole process is following:

  1. Move to certain web page.
  2. Type your personal username and password into form, select certain radio button and hit submit button. After this the page reloads and gives you temporary credentials for proxy server.
  3. Open browser’s settings. Select custom proxy and type the address of automatic proxy configuration file (.pac). Save and close settings.
  4. Move to some secured page. Browser now asks username and password for proxy server. Give your temporary crendentials and you have access.

That’s it. Not very convenient…

So, is it possible to save text from web page to a file and then read this information from file and type it into browser’s dialog box? Or something like that…

Any ideas are welcome.