curl-and-php
RE: Navigating website with curl lib
Date: Tue, 3 Jul 2007 23:59:39 +0200 (CEST)
On Tue, 3 Jul 2007, Bob wrote:
>>> My understanding from reading the libcurl info is each page wanted must be
>>> gotten with it's own curl_exec and any setopt's done in the first
>>> curl_exec are in effect for all following curl_exec. Is this correct?
>> Yes.
> Is this true even if each group of libcurl statements end a curl_close
> ($ch);
No, curl_close() closes a handle and then it also forgets all settings that
were set to it.
>> cookiejars are saved when the handle is closed.
> So does that mean if I do not have a curl_close ($ch); statement between
> executions of inline groups of libcurl statements that the cookies are being
> passed between steps automatically???
Yes.
>>> Where is the CURLOPT_COOKIEJAR, "-" statement really putting the cookies?
>>> To stdout!
> Does that mean that CURLOPT_COOKIEFILE, "-" is stdin
No.
> and the cookie is really being passed between steps??
Cookies are kept in the handle (once libcurl is told to rececive them) no
matter if you save them or not, and then they will be used on subsequent
requests if they match the host and path etc-
>> Use the command line tool (curl) instead and --trace-ascii for full
> logging.
> I was talking about debug code in the libcurl statements.
You don't use libcurl, you use PHP/CURL. If you'd used libcurl I'd said you
should use CURLOPT_DEBUGFUNCTION for the best trace outputs. Now you can read
my previous reply again.
>>> Is there some way to select the LINK on a retrieved page to follow?
>> "select" a link means getting the URL. And yes, (lib)curl can do that.
> I do not understand this answer. A link is an auto jump to some other page.
You seem to have a different vocabulary than I do. In my world a link is
something on a web page that takes you to another place when you click it. I
don't know what you're referring to. A javascript-controlled link?
> How do I tell libcurl to take the 4th link on the just retrieved page and
> jump to the page?
To "jump" to the page, curl-wise, you get it. And there's lots of examples how
to get a page using PHP/CURL, I don't think I need to tell you.
> When posting fields to a logon page does libcurl automatically click the
> submit button for you?
libcurl clicks no buttons at all, libcurl speaks internet-protocols and they
don't have buttons.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.html _______________________________________________ http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-phpReceived on 2007-07-04