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 3w 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 69% 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

3465d 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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