This is a discussion on Browser like behavior within the PHP Language forums, part of the PHP Programming Forums category; Hi, What is the easiest way to use jakarta HttpClient 3.0 , to behave like browser executing methods with sequential ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
What is the easiest way to use jakarta HttpClient 3.0 , to behave like browser executing methods with sequential URLs? For example: I'm executing method with `http://google.com` Then I'm executing method with `/catalog1/` (My aim is to execute with `http://google.com/catalog1/`) Then I'm executing method with `index2.html` (My aim is to execute with `http://google.com/catalog1/index2.html`) Then I'm executing method with `/catalog2` (My aim is to execute with `http://google.com/catalog2/`) What I want is to simulate browser behavior dealing with URLs in links, forms and so on. Anyone has experience in that field? Thanks. M. |
|
|||
|
Marcin <gogosystems@gazeta.pl> wrote:
> What is the easiest way to use jakarta HttpClient 3.0 , to behave like > browser executing methods with sequential URLs? > For example: [snip] > What I want is to simulate browser behavior dealing with URLs in links, > forms and so on. > > Anyone has experience in that field? Yes, but what has this to do with PHP? You have to disect the URL (like with http://nl2.php.net/manual/en/function.parse-url.php), remember last URL and check if the path starts with a / of not. If it does append it to the host part, else append to current. |