Witajcie,
Spędzam już trochę czasu nad pewną funkcją, która ma za zadanie analizować kod HTML. Do wykonania użyłem biblioteki curl. Ustawiłem nagłówki na wzór z przeglądarki. Serwer odpowiedział i wyświetliły się krzaki. Obstawiam że kod jest zaszyfrowany i moje pytanie Jak sobie z tym poradzić aby przekonwertować to do czystego tekstu.
Kod Funkcji
[code]
$url = 'https://.......';
// In this example we are referring to a page that handles xml
$headers = array( "Content-Type: text/html",);
// Initialise Curl
$curl = curl_init();
if ($curl === false)
{
throw new Exception(' cURL init failed');
}
// Configure curl for website
curl_setopt($curl, CURLOPT_URL, $url);
// Set up to view correct page type
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// Turn on SSL certificate verfication
curl_setopt($curl, CURLOPT_CAPATH, "inc/cacert.pem"); //pobrany plik z różnymi CA
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);
// Tell the curl instance to talk to the server using HTTP POST
curl_setopt($curl, CURLOPT_POST, 1);
// 1 second for a connection timeout with curl
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
// Try using this instead of the php set_time_limit function call
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
// Causes curl to return the result on success which should help us avoid using the writeback option
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
echo $result = curl_exec($curl);
[/code]
oraz zrzut wyświetlanej strony