Menu

How can I know when the crawler has finished?

Help
Anonymous
2013-08-19
2013-08-20
  • Anonymous

    Anonymous - 2013-08-19

    I need to do some cleaning stuff when my crawler has finished all the links to crawl.

    First I tried to override getProcessReport, but I may not call this function at all, as all my information gathered will reside in a database.

    How can I do this?

     

    Last edit: Anonymous 2013-11-19
  • Anonymous

    Anonymous - 2013-08-19

    Hi!

    The go() method just returns when everything is finished, so just do all you cleanup stuff right after the go()-method in your scipt.

     
    • Anonymous

      Anonymous - 2013-08-19

      Hi!!
      How you know that the method go has finished successfully?. if the method go() does not return any value.

       
  • Anonymous

    Anonymous - 2013-08-19

    Like this:

    ...
    $crawler->go();

    $Report = $crawler->getProcessReport();

    if ($Report->abort_reason == PHPCrawlerAbortReasons::ABORTREASON_PASSEDTHROUGH)
    {
    echo 'Everything done";
    }

    Take a look at the documentation of the PHPCrawlerAbortReasons-constants for further information:
    http://phpcrawl.cuab.de/classreferences/PHPCrawlerAbortReasons/overview.html

     
    • Anonymous

      Anonymous - 2013-08-20

      Hi!!!

      Thanks a lot for your support.

       
  • Anonymous

    Anonymous - 2013-08-20

    Glad i could help!

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.