How to create connection to screen scraper from php

Please anyone can tell me that how can I run screen scraper from php.Just small WAP, and how to connect screen scraper to localhost:8778.

Here's a little script I use

Here's a little script I use to launch many parallel copies of the same scrape:

<?php
// Set number of concurrant threads
$concurrant = 20;

// Set seconds to pause between scrapes
$pause = 2;

// Screen-scraper driver
require('remote_scraping_session.php');

// Define scrape
$sname = "scrape_name";
$sloc = "localhost";
$sport = 8778;

// Start scrape
for ($i=0; $i<$concurrant; $i++)
{
        $session = new RemoteScrapingSession;
        $session->initialize($sname, $sloc, $sport);
        $session->setDoLazyScrape(true);
        $session->scrape();
       
        // Check for errors.
        if($session->isError())
        {
                echo "An error occurred: " . $session->getErrorMessage() . "<br />";
                exit();
        }
       
        // Pause
        sleep($pause);
}

?>

Error: connection is not establish

Jason thanks for a WAP.I am using Ubuntu,screen-scraper(Professional).I paste your content in index.php under www directory and paste remote_scraping_session.php file too.After that I run screen-scr. .when I enter localhost:8778 in url ,getting an error.Please jason can you tell me what step I will follow that my connection get establish successfully .

The web-controller on

The web-controller on localhost:8779 is only on enterprise edition. You just need to:

  1. Clear your screen-scraper/log directory
  2. Start screen-scraper server with the command "./server start"
  3. Run your PHP file. You can open it with a browser or just command line

You should either get an error from the PHP or see your scrapes start logs to indicate they are running.

Thanks a lot.Its working.

Thanks a lot.Its working.