PHP code example of bpteam / quick-parse-wizard

1. Go to this page and download the library: Download bpteam/quick-parse-wizard 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/ */

    

bpteam / quick-parse-wizard example snippets


use bpteam\QuickParseWizard\Loader\GuzzleWithRetryLoader;

$loader = GuzzleWithRetryLoader::create(
    defaultGuzzleOptions: [], // For more information see https://docs.guzzlephp.org/en/stable/request-options.html
    defaultRetryOptions: [ // For more information see https://github.com/caseyamcl/guzzle_retry_middleware?tab=readme-ov-file#options
        'retry_on_status' => ['503', '502', '429'],
        'retry_on_timeout' => true,
    ],   
);

$response = $loader->load('https://example.com');

echo $response->body;

use bpteam\QuickParserWizard\Loader\BrowserScrapeCrusaderLoader;

$loader = new BrowserScrapeCrusaderLoader(
    xRapidAPIKey: 'your-api-key-from-rapidapi.com', // For more information see https://rapidapi.com/bpt22/api/scrapecrusader
);

$response = $loader->load('https://example.com');

echo $response->body;

use bpteam\QuickParserWizard\ApiKeyRotator\ApiKeyArrayProvider;

$apiKey = new ApiKeyArrayProvider();
$apiKey->add('my_key_name', new Key('MY_FIRST_API_KEY'), 1000, new \DateInterval('PT1M'));
$apiKey->add('my_key_name_2', new Key('MY_SECOND_API_KEY'), 1000, new \DateInterval('PT1M'));

$key = $apiKey->find();

echo $key->getCredentials(); // MY_FIRST_API_KEY