PHP code example of nagara / hunter-php

1. Go to this page and download the library: Download nagara/hunter-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nagara / hunter-php example snippets





use HunterPHP\Hunter;

$hunter = new Hunter;

echo "<h1>Web Data Extraction for Title Journal or Article at Online Journal</h1>";
echo "<h2>study case Web Data extraction for non Headless Browser</h2>";

// example get data from springe open journal
echo "<h3>springer open journal : data extraction -> keyword apriori</h3>";
dump($hunter->scrap("springeropen", "apriori"));

// example get data from google scholar open journal
echo "<h3>google scholar open journal : data extraction -> keyword AI</h3>";
dump($hunter->scrap("google_scholar", "AI"));

// example get data from neliti open journal
echo "<h3>neliti open journal : data extraction -> keyword AI</h3>";
dump($hunter->scrap("neliti", "AI"));

// example get data from research gate open journal
echo "<h3>research gate open journal : data extraction -> keyword AI</h3>";
dump($hunter->scrap("research_gate", "AI"));




unterPHP\Hunter;

$hunter = new Hunter;

$keyword = "apriori";

$springeropen = $hunter->scrap("springeropen", $keyword);
$google_scholar = $hunter->scrap("google_scholar", $keyword);
$neliti = $hunter->scrap("neliti", $keyword);
$research_gate = $hunter->scrap("research_gate", $keyword);

$html = <<<HTML
<h1>example with table<h1>
HTML;
echo $html;

bash
composer