Grizzly has asked for the wisdom of the Perl Monks concerning the following question:

Hey there, I am pondering this idea and was hoping we could share some discussion on it.

Basically, I have a *few* peoples details and I am meant to be creating them accounts at a particular web site. Does anyone know if i can make a script that opens the website, fills in the details using information stored in a .txt and submit each one? (Loop) This would be a lot simpler than putting each of the many members through individually since there a lot of members.

Just going off topic a bit. Anyone have any ideas on how to create random information to put through a form, and have it submit it?

I have worked out (using the information on this site) some of the things i would need to do. I was hoping someone else could shed some light?

Replies are listed 'Best First'.
Re: Filling in forms.
by sutch (Curate) on Jan 14, 2001 at 01:23 UTC
    Try using HTTP::Request and LWP::UserAgent to post forms. This recent posting has some code that may help.
Re: Filling in forms.
by Chady (Priest) on Jan 14, 2001 at 13:54 UTC
    not sure what are you talking about here... where would the information about every user submit to?? and after that, what is done with it?? so since you are already going to write the .txt file, why fill in forms and submit?
    I suggest, if you know how to handle files (open/read/write), that you construct a - would rather call it engine - that reads from the .txt file and do whatever with the information read, generating .html files in a specific folder maybe...

    another way to do this, is keep the information in the .txt file, entering each member's information on a single line, seperated by a specific character (eg: ?) then when you want to access a specific user, you can read the specific line from the .txt file, split it into diffrent variables and paste it in place in the generated .html document.

    most of this is pretty basic stuff, so I think that it will be easy to do.. the hard task will be filling that .txt file.


    Chady | http://chady.net/
Re: Filling in forms.
by elusion (Curate) on Jan 14, 2001 at 06:59 UTC
    There's another way you could do this, might be simpler for you, I don't know. You could create some javascript on html using perl. I know it's noone's favorite, but it works. Just take all of the form fields and create lines like this in the HTML
    <input type='hidden' name='value1' value='$userfile{file1}'>
    Then in the body tag add:
    onLoad='document.formname.submit()'
    You'd then need to view each of the pages in a browser, and wait for it to submit. Hope this helps.

    - p u n k k i d
    "Reality is merely an illusion, albeit a very persistent one." -Albert Einstein