Download the PHP package shamanhead/phpporser without Composer

On this page you can find all versions of the php package shamanhead/phpporser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpporser

Phporser

Getting Started

Requirements

Requires PHP 7.1+.

Also needs Headless Chromium PHP and chromium executable, if you want to use this library with headless browsing support(includes by standart in packagist version).

Installing via composer

$ composer require shamanhead/phpporser

Installing via archive

You can install this library also from archive, by downloading it from github. There is no dependendies needed, besides Headless Chromium PHP, if you want to use this library with headless browsing feature. Installing chromium executable If you want to use this library with headless browser, first you need to download executable of this browser.

This might works on Windows, MacOs and Linux.

Choose browser that you want to use

Headless chromium supports all chomium-based browsers, like Chrome, Opera, Chromium etc.

Installing chromium executable

I can recommend to use chromium instead of chrome, because of my observation he works better than chrome.

So, go on the official chromium browser downloading page and download it.

After doing this step, unpack archive and move to necessary place.

Then, specify path in your script:

If you done all right, parser would work. If you have any errors occuring during this step, you can go see here, is there solution to solve your problem. In other case, please, open new issue here or on Headless Chromium PHP page.

Parsing your first page

Huh, half of work done. So now, let's try to parse simple page, like Computer sciense on wikipedia. With the help of it, I will show all the capabilities of the parser.

First of all, let's try to get 'Computer sciense' string on top of the page:

It's works! But how? Let's me explain:

  1. Parser get's all tags with name 'h1'
  2. Then parser get's all tags with class 'firstHeading' in h1 tags range(and it's dependencies)
  3. Get's text from it
  4. Converts result array to string format

Search methods

To find elements in html dom, there is 4 functions in this library:

You can combine search methods with each other, to find elements in special way:

Working with text

Contribute

Hey, want to contribute? Just notice me on my email ( b>[email protected]

License

See the LICENSE file.


All versions of phpporser with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
chrome-php/chrome Version ^v0.10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shamanhead/phpporser contains the following files

Loading the files please wait ....