Help to auto complete web form - Batch file or script??

--Tony--
--Tony-- Posts: 1,752 Forumite
Part of the Furniture 1,000 Posts Name Dropper Photogenic
There is a web page I need to keep completing with the same information.

Is there a way to auto complete the form with some kind of batch file or script. I use a batch file now to open several IE sessions at once but I don't think you can use dos commands to do what I'm looking for?

I know the simple way would be to download form filling software or a toolbar but its a work PC and I can't do that.

The form in question does not save in microsoft auto-complete either, I think the form may be in java as when you click submit the web page does not move on, ie you can't click back to go back you can only click refresh to start again.

Any ideas welcome.
.

Comments

  • tshabs
    tshabs Posts: 11 Forumite
    Hi, any chance you can point us towards this form to take a look?

    I would suggest using visual basic with the webbrowser control. Setting the focus to each text box one by one and inputting the text required.
    This tends to work only with standard html forms.
  • --Tony--
    --Tony-- Posts: 1,752 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    Sorry I can't point you to it as it on our network thats why I have to use the work computer to get to it.

    Thanks Tony
    .
  • tshabs
    tshabs Posts: 11 Forumite
    Ok, are you familiar with visual basic at all?
  • --Tony--
    --Tony-- Posts: 1,752 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    I am a little but only really with macros in excel
    .
  • Chippy_Minton
    Chippy_Minton Posts: 3,339 Forumite
    You can use scripting (JScript, VBScript etc.) to automate Internet Explorer. The script opens IE, loads the URL, accesses the HTML document and manipulates its content, for example by filling in form field data.

    There is an example of the technique here, with a sample HTML page and VBScript code to populate the form fields. It's for IE4, but should work for IE6.

    I've knocked up the following code to populate the search box on https://www.moneysavingexpert.com. Open Notepad, copy and paste the code below and save the file as IEpopulateField.vbs. Double-click IEpopulateField.vbs to run it.
    'IEpopulateField.vbs
    'Populates a form field
    
    Option Explicit
    On Error Resume Next
    
    Dim url, ie
    
    url = "www.moneysavingexpert.com"
    Set ie = WScript.CreateObject("InternetExplorer.Application", "ie_")
    ie.Visible = true
    ie.Navigate url
    
    'Wait for page to load
    Do While ie.Busy Or ie.ReadyState = 1
    Loop
    
    'Write value in the HTML form field named 'string'
    ie.Document.all("string").value = "Martin Lewis"
    
    sub ie_onQuit
    	WScript.Quit
    end sub
    
  • --Tony--
    --Tony-- Posts: 1,752 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    Thank you so much for that I will have a play in the morning.

    Fantastic!
    .
  • --Tony--
    --Tony-- Posts: 1,752 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    Thanks for helping, having tried and looking at the source, the form is flash (form.swf) and as the text fields are not listed there is no location to tell it to put the text in.

    I guess this makes it a lot harder.

    Out of interest hitting the tab key puts the curser in the first box. If there was a way to do this:

    Tab
    write text
    tab
    write text
    etc etc

    It would do the trick.
    .
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.1K Banking & Borrowing
  • 252.8K Reduce Debt & Boost Income
  • 453.1K Spending & Discounts
  • 243.1K Work, Benefits & Business
  • 597.4K Mortgages, Homes & Bills
  • 176.5K Life & Family
  • 256K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.