PHPackages                             byjg/pgbrowser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. byjg/pgbrowser

ActiveLibrary[HTTP &amp; Networking](/categories/http)

byjg/pgbrowser
==============

A 'pretty good' mechanize-like php library for managing cookies and submitting forms. \[Fork: Totally rewrite\]

1.0.0(10y ago)433.8kPHPPHP &gt;=5.3.0

Since May 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/byjg/pgbrowser)[ Packagist](https://packagist.org/packages/byjg/pgbrowser)[ RSS](/packages/byjg-pgbrowser/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

PGBrowser
=========

[](#pgbrowser)

A 'pretty good' mechanize-like php library for managing cookies and submitting forms. \[Fork Version\]. This fork version was totally refactored for PSR-0 full compliant and was implemented the persistence of cookies between connection in the same session instance (good for crawling)

Read the [Documentation](https://github.com/monkeysuffrage/pgbrowser/wiki)

```
require 'vendor\autoload.php'

$b = new \PGuardiario\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-&gt;html or query it with $page-&gt;xpath-&gt;query()

PGBrowser will also let you query the page with phpquery, simple-html-dom, [advanced-html-dom](https://sourceforge.net/projects/advancedhtmldom/) or xpath:

```
require 'vendor\autoload.php';

$browser = new \PGuardiario\PGBrowser(\PGuardario\PGBrowser::PHPQUERY);
$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'

```
$browser->useCache = true; // turn on cacheing
$browser->useCache = false; // turn off cacheing
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~243 days

Total

2

Last Release

3420d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/981924?v=4)[Joao Gilberto Magalhaes](/maintainers/byjg)[@byjg](https://github.com/byjg)

---

Top Contributors

[![pguardiario](https://avatars.githubusercontent.com/u/58795222?v=4)](https://github.com/pguardiario "pguardiario (58 commits)")[![byjg](https://avatars.githubusercontent.com/u/981924?v=4)](https://github.com/byjg "byjg (21 commits)")

### Embed Badge

![Health badge](/badges/byjg-pgbrowser/health.svg)

```
[![Health](https://phpackages.com/badges/byjg-pgbrowser/health.svg)](https://phpackages.com/packages/byjg-pgbrowser)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
