jtanjung/pehape

There is no license information available for the latest version (v2.1-beta) of this package.

A collection of PHP libs

v2.1-beta 2023-02-21 08:06 UTC

README

Install

Via Composer

composer require jtanjung/pehape

Contents

This package contain several webdriver executable files which are needed by WebPageService to run its functionalities. As for the default webdrivers, please refer to these 3 different browser below:

  • Chrome v90.x
  • Firefox v75.0
  • Opera v75.x

Links

For other version of the webdriver, please follow these links below:

Note: The version of the browser and its driver must be compatible!

Example

If you decide to use a different version of the browser and its version, you may use this code below as a reference:

use Pehape\Services\WebPageService;

$service = new WebPageService();
//$service->config->Setting->firefox->command = '{driver folder}/geckodriver'; // Geckodriver use 4444 as a default port
$service->config->Setting->chrome->command = '{driver folder}/chromedriver --port=4443'; // Set port 4443 for chrome
//$service->config->Setting->opera->command = '{driver folder}/operadriver --port=4445'; // Set port 4445 for opera

/** If you decide to use different ports, you also must change the host config value. e.g below: **/
/*
$service->config->Setting->chrome->command = '{driver folder}/chromedriver --port=5000';
//$service->config->Setting->opera->command = '{driver folder}/operadriver --port=5001';
$service->config->Setting->chrome->host = "http://localhost:5000";
//$service->config->Setting->opera->host = "http://localhost:5001";
*/

$service->Chrome()->Create();
$service->get('https://www.google.com/');
$service->quit();

See more examples here