Menu

Crawling multiple sites in one session

Help
Anonymous
2014-01-27
2014-01-28
  • Anonymous

    Anonymous - 2014-01-27

    I have a set up which should, in theory, grab a URL from a resources SQL database. It should then set up a PHPcrawl instance and do various actions based on what it finds. The script works fine for the first URL, but then doesn't work for the next one. What have I done wrong?

    ---Pseudo Code---

    $urlArray = array;
    $count = count($urlArray);

    for ($i=0; $i<$count; $i++) {
    $url = $urlArray[$i];
    crawlForExternals($url);
    }

    funtion crawlForExternals($url) {

    class MyCrawler extends PHPCrawler {
        function handleDocumentInfo($DocInfo) {
            //do stuff with URLs
        }
    }
    
    $crawler = new MyCrawler();
    ...
    $crawler-> go();
    

    }

    What's making that fail?

     
  • Anonymous

    Anonymous - 2014-01-28

    Hi!

    So what happens for the second URL? Does your script/the crawler throw an error or exception?

     

    Last edit: Anonymous 2014-01-28

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.