pribolshoy / parseroid
Public library
v0.1.0-alpha.3
2026-08-29 20:57 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-dom: *
- ext-simplexml: *
- phpstan/phpstan: ^1.10
Requires (Dev)
- phpunit/phpunit: ^9.5.10
- squizlabs/php_codesniffer: ^3.9
- vlucas/phpdotenv: *
This package is not auto-updated.
Last update: 2026-08-31 14:15:45 UTC
README
Package for parsing different types of resources (html pages, xml etc.).
This package is not ready solution for all resource types.
It just giving you necessary abstract functional for constructing you own needs. But in a way that makes it easy for you to do.
HTTP proxies (Curl)
Optional list of proxies via env PARSEROID_PROXIES. On each request Curl picks one at random.
# JSON array PARSEROID_PROXIES='["http://user:pass@1.2.3.4:8080","socks5://5.6.7.8:1080"]' # or comma-separated (host:port → http://) PARSEROID_PROXIES=1.2.3.4:8080,http://5.6.7.8:3128
Empty / unset — direct connection. Last used proxy: Curl::getLastProxy(). Programmatic override: ProxyConfig::setProxies([...]).
Simple example:
<?php
require_once "vendor/autoload.php";
$handler = (new \pribolshoy\parseroid\factories\HandlerFactory())
->create('html_page_handler', [
'parser_name' => 'google_parser',
'resource' => 'https://www.google.com/search?q=php+it%27s+amazing',
]);
$result = $handler->getItem();
print_r($result);
//<pre>Array
//(
// [0] => Array
// (
// [input_text] => php it's amazing
// )
//
//)
//</pre>
?>