Käynnissä

Script Fix

Hello,

I´m currently running a crawler that uses the phpcrawler php class which works fine with almost all pages/urls, but with certain pages there occurs a problem which basically is that the script stops working without giving any error message or anything like that.

Now an example of a page on such a problem occurs would be:

[url removed, login to view]

Now here would be a demo code, which would simply stop - always at the same page ([url removed, login to view]):

include("classes/phpcrawler.class.php");

class MyCrawler extends PHPCrawler

{

function handlePageData($page_data)

{

echo "Page requested: ".$page_data["url"]."<br>";

echo "Status: ".strtok($page_data["header"], "\n")."<br>";

echo "Referer-page: ".$page_data["referer_url"]."<br>";

if ($page_data["received"]==true)

echo "Content received: ".$page_data["bytes_received"]." bytes";

else

echo "Content not received";

echo str_pad(" ", 5000); // "Force flush", workaround

flush();

}

}

// Klasse laden

$crawler = new MyCrawler();

$crawler->setURL("http://www.ejs-kajak.de");

$crawler->setFollowMode(1);

$crawler->addReceiveContentType("/text\/html/");

$crawler->addNonFollowMatch("/.(jpg|gif|png)$/ i");

$crawler->setCookieHandling(true);

$crawler->setTrafficLimit(0);

$crawler->setPageLimit(0);

$crawler->go();

$report = $crawler->getReport();

print_r($report);

Now the job would be to fix the class, so that this doesn´t happen any more.

Taidot: PHP

Näytä lisää: referer url php, fix html error, error on page fix, crawler page_data, fix or now, certain report, url fix, message crawler, crawler report, script function, force gif, php header script, demo works, script message, problem fix, script php html text, php script echo, always running, demo crawler, html page fix, html jpg php script, echo fix url php, png php code, echo script php, header fix

Tietoa työnantajasta:
( 14 arvostelua ) Graz, Austria

Projektin tunnus: #395684

Myönnetty käyttäjälle:

eXternalDesign

Kindly see your PM.

50 $ USD 0 päivässä
(45 arvostelua)
6.2

2 freelanceria on tarjonnut keskimäärin 40 $ tähän työhön

Ciprian79

If you agree I will take a look at your scripts

30 $ USD 1 päivässä
(0 arvostelua)
0.0