serp-spider / search-engine-google

:spider: Google client for SERPS
https://serp-spider.github.io
Other
165 stars 61 forks source link

How can I test it? #120

Closed MrZANO closed 4 years ago

MrZANO commented 4 years ago

sorry but I just can't figure out how to implement a simple test.

Starting from the guidelines I tried to use version 0.1 0.2 and now 0.4.8 but nothing has changed where am I wrong?

<?php
    use Serps\SearchEngine\Google\GoogleClient;
    use Serps\HttpClient\CurlClient;
    use Serps\Core\Browser\Browser;
    use Serps\SearchEngine\Google\GoogleUrl;

    $userAgent = 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36';
    $language = 'en-US,en;q=0.8';

    $browser = new Browser(new CurlClient(), $userAgent, $language, $someProxy, $someCookies);

    // Create the url that will be parsed
    $googleUrl = new GoogleUrl();
    $googleUrl->setSearchTerm('simpsons');

    $googleClient = new GoogleClient($browser);
    $response = $googleClient->query($googleUrl);

    $results = $response->getNaturalResults();

var_dump($results);

//    foreach($results as $result){
        // Analyse the results
 //   }
?>
MrZANO commented 4 years ago

I need help. please