-   Linux - Software (
-   -   How can I save my time not to do the same repetitive job in a webpage to fill a form (

pokhraa 12-24-2011 02:14 PM

How can I save my time not to do the same repetitive job in a webpage to fill a form
My job is: against a Policy no I entered some data which is same for next 1000 Policy No. For ex- the buttons are

N, Y N, N Y, Y, Y, DDMMYYYY, DDMMYYYY, DDMMYYYY, Y,N,Y,N. After typing again I press either ENTER or TAB button to

complete the process.Between two policy nos, I pressed buttons 42 times in the above manner including ENTER or TAB.

I performed the job in Mozilla Firefox 4.0.0 where in the first page imacro works. But after login imacro does not

works and also right click does not works. Is there any way by which policy no came from a EXCEL spreadsheet and

other repetitive jobs will be done automatically? It will save a lot of time and relieved me from a monotonous job.

theNbomr 12-24-2011 05:33 PM

You may be able to use something like wget or curl in a shell script, looping over each policy number. If the numbers are sequential and sorted, you can use a shell variable to compute the numbers, otherwise they can be generated and read from a file. It will take a little research to see what is required. Use a conventional browser, and get it to display the page source HTML, probably by right-clicking somewhere on the page. If the HTML source contains a construct that contains an HTML <form> element, you are probably in luck. Even better would be if it uses

. If it does, then you will almost certainly be able to script the solution. The form should contain the same number of elements as you are required to type in, and you may be able to identify their names (but not necessarily).
Let us know what you find.
Here is a sample of what to look for, extracted from a LQ search page:

<form action="/questions/search.php" method="post">
        <input type="hidden" name="do" value="process" />
        <input type="hidden" name="showposts" value="1" />
        <input type="hidden" name="quicksearch" value="1" />
        <input type="hidden" name="s" value="" />

The <form> tag is followed by its method type ("post", in this example), and a bunch in input elements. With luck, you should find something similar. If you need help deciphering, post a sample (definitley use [CODE][/CODE] tags), and someone should be able to assist you.

--- rod.

jefro 12-24-2011 05:39 PM

Wonder if a program like expect would work?

All times are GMT -5. The time now is 06:06 AM.