<?php $pageurl = "http://jobseekers.direct.gov.uk/homepage.aspx"; $ch1 = curl_init($pageurl); curl_setopt($ch1, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3'); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); // gzip curl_setopt($ch1, CURLOPT_ENCODING, 'gzip'); // deflate curl_setopt($ch1, CURLOPT_ENCODING, 'deflate'); curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, 1); // gzip, deflate curl_setopt($ch1, CURLOPT_ENCODING, 'utf-8'); curl_setopt($ch1, CURLOPT_HEADER, 1); curl_setopt($ch1, CURLOPT_NOBODY, 1); curl_setopt ($ch1, CURLOPT_URL, $pageurl ); $html = curl_exec ( $ch1 ); curl_close($ch1); $id = $matches[1][0]; 'Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7'); $ch = curl_init('http://jobseekers.direct.gov.uk/listjob.aspx?sessionid='.$id.'&pid=2&sid=322801553&p=1&so=1'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3'); // gzip curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); // deflate curl_setopt($ch, CURLOPT_ENCODING, 'deflate'); // gzip, deflate curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_close($ch); ?>
coś tu nie gra, może macie jakieś pomysły ?
@edit: w ciastkach nie ma dosłownie nic, sprawdzałem. Po prostu jakoś zapomina o poprzedniej sesji
@edit:
headersy po pierwszym cURL i odpowiednio po drugim:
HTTP/1.1 302 Found Date: Sat, 29 Oct 2011 03:24:53 GMT Location: /homepage.aspx?sessionid=8c349585-d57d-4ea6-92ea-b757829d5a07&pid=1 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 194 HTTP/1.1 200 OK Date: Sat, 29 Oct 2011 03:24:53 GMT Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 27467
HTTP/1.1 302 Found Date: Sat, 29 Oct 2011 03:24:53 GMT Location: /homepage.aspx?sessionid=8c349585-d57d-4ea6-92ea-b757829d5a07&pid=2 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 194 HTTP/1.1 302 Found Date: Sat, 29 Oct 2011 03:24:53 GMT Location: /homepage.aspx?sessionid=5357b28f-b515-44e3-a411-c7c8cce05494&pid=1 Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 194 HTTP/1.1 200 OK Date: Sat, 29 Oct 2011 03:24:53 GMT Cache-Control: no-cache Pragma: no-cache Expires: -1 Content-Type: text/html; charset=utf-8 Content-Length: 27833