cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Access Denied - Help Needed!!

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 Jun 2006 09:50:33 +0200 (CEST)

On Mon, 26 Jun 2006, Matt Switzer wrote:

> Thanks for the tips. I have used all the tools referenced below and they
> were a great help. When I review the header info, it seems that curl is
> returning a script referenced by the actual page I want, not the page
> itself.

Its more likely the other way around. curl downloads the contents the server
provides for that particular URL. Nothing more, nothing less.

However, your ordinary browser interpret the content and acts. Like when the
contents is HTML with embedded javascript your browser might continue
somewhere else, while curl certainly will not.

> I set CURLOPT_FOLLOWLOCATION to false, but it still seems to be returning
> the referenced script instead of the page I referenced in CURLOPT_URL
> (http://www.mls.ca/PropertyResults.aspx?ci=Toronto&st=90+Sumach).

If you capture the traffic to see the response body your browser gets and
compares with that curl gets, you'll see that they get the very same thing (if
the request headers are similar enough so that the server doesn't make a
difference in what it responds with).

> Is there a setting that I am missing, or one that you might recommend that
> would help in this situation?

If it indeed is javascript (or by all means a http refresh in HTML) you need
to interpret that and tell curl how to get the next page as curl won't do that
by itself.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-06-27