PHP Classes

PGBrowser: Access remote site pages submitting forms

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 47%Total: 274 All time: 7,676 This week: 71Up
Version License PHP version Categories
pgbrowser 0.1GNU General Publi...3.0HTML, HTTP, PHP 5
Description 

Author

This package can access remote site pages submitting forms to emulate a normal Web browser.

The main page browser class can send HTTP requests to remote Web site servers to retrieve pages of a given URL.

It can analyze the contents the retrieved page and find the forms it may contain.

A forms processing class can submit new HTTP requests to emulate the submission of the found forms, eventually after setting form inputs to given values.

The browser class can return details of the retrieved pages like the page title.

The user agent defined in the HTTP requests set to the Web server is a configurable parameter.

Picture of P Guardiario
Name: P Guardiario <contact>
Classes: 6 packages by
Country: Philippines Philippines
Age: ???
All time rank: 162118 in Philippines Philippines
Week rank: 215 Up4 in Philippines Philippines Up

Details

PGBrowser ========= A 'pretty good' mechanize-like php library for managing cookies and submitting forms. Read the [Documentation](https://github.com/monkeysuffrage/pgbrowser/wiki) ```php require 'pgbrowser.php'; $b = new PGBrowser(); $page = $b->get('http://www.google.com/'); $form = $page->form(); $form->set('q', 'foo'); $page = $form->submit(); echo $page->title; ``` Now do something with $page->html or query it with $page->xpath->query() PGBrowser will also let you query the page with phpquery, simple-html-dom, [advanced-html-dom](https://sourceforge.net/projects/advancedhtmldom/) or xpath: ```php require 'pgbrowser.php'; require 'phpquery.php'; $browser = new PGBrowser('advanced'); $page = $browser->get('http://www.google.com/search?q=php'); foreach($page->search('li.g') as $li){ echo $li->at('a')->text . "\n"; } ``` *New* - PGBrowser can now cache requests to disk and reuse them on subsequent requests to save network traffic. Cached responses go into a folder called 'cache' ```php $browser->useCache = true; // turn on cacheing $browser->useCache = false; // turn off cacheing ```

  Files folder image Files (3)  
File Role Description
Accessible without login Plain text file example.php Example Example script
Plain text file pgbrowser.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:274
This week:0
All time:7,676
This week:71Up
 User Ratings  
 
 All time
Utility:58%StarStarStar
Consistency:75%StarStarStarStar
Documentation:50%StarStarStar
Examples:58%StarStarStar
Tests:-
Videos:-
Overall:47%StarStarStar
Rank:3073