cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl tests for the test suite

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 20 Dec 2002 09:36:49 +0100 (MET)

On Thu, 19 Dec 2002, Sanjeev wrote:

> Since cURL is a great package which can also be used for scripting, (
> often unattended.) there might arise a need for a user often to submit web
> pages blindly ( i mean unattended mode ).

Oh yes, that's certainly one of the good points about curl that I myself use
rather frequently.

> Example being, in one of the mails, i sent a form based html page, which
> has a pulldown menu, on selecting a particular menu, the page diplays
> altogether, a different form.
>
> Here i dont know, what are the fields of the form. I only know onething,
> for every form there are two *MUST* fields in common which i should fill
> in.
>
> What i'm unaware of in this situation is that, what are the other *MUST*
> fields, without which the page cannot be submitted.

You cannot know which fields that you "*MUST*" provide, as such information
is not included in the form HTML. All you get to know is what fields that a
browser will display to the user and which it would send off to the server
when submitting.

> So, for my job to get done, the parser i wrote helped me. with the
> WRITEFUNCTION callback, i passed the data to this parser which then stored
> all the fields in a struct. ( one good thing for me which helped is that,
> the forms i get dynamically are not much complicated ).

Well, I too got hit by the problems with forms, complicated/unreadable HTML
and trying to figure out what to post back. Therefore I started writing a
script back in 1998 named 'formfind' that helps me with this:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/perl/contrib/formfind?rev=HEAD&content-type=text/vnd.viewcvs-markup

Since neither your code nor formfind can fill in the form automaticly, I
don't see the point in having it parse the form-HTML inside curl. You still
need to provide lots of information manually to do the proper POST operation.

> Its my bad luck if L'GPL covers the 'ideas of approach' also.

No, it doesn't. LGPL is protecting the particular implementaton. To cover
"ideas" you use patents.

> If above sounds Ok for you, please take a look at the modified parse.c file
> i attached below. ( I took out few major bugs and customized the struct
> from yesterday's file. )

I still feel that you have re-implemented formfind in C, which may be fine
for some poeple, but I don't see the need to add this to curl.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
Received on 2002-12-20