Download the PHP package aprillins/litegrabber without Composer

On this page you can find all versions of the php package aprillins/litegrabber. 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 litegrabber

LiteGrabber

LiteGrabber is a simple website content scrapper that utilizing the default PHP DOMXPath class.

Installation

You can install LiteGrabber using Composer.

composer require aprillins/litegrabber:dev-master

Then, update your package.

composer update

Don't forget to execute composer dumpautoload after the installation.

Usage

Using LiteGrabber is tremendously easy. Scrapping can be done with three simple step. First, create the LiteGrabber instance.

Second, create the query for which element you want to scrap. For example, if you want to get a link from a tag inside div tag the query will be like this.

OR Since 1.2 you can build the query simpler than before. The way it works is like this.

Third, let's get the result!

The result will be returned in a form of array. The result will be an empty array if your query compositions don't match with the actual element on a web page you want to scrap.

Query Explanation

On the second step above, you see that div([], true) have to parameters. The first one is specification of tag attribute. If you want to scrap specifically from div which has certain class attribute with certain value. You have to set the array.

Example above will set the query to <div class="post-wrapper home">. You MUST NOT forget to put second argument to true for the first query. Whoops don't worry since version 1.2 you MAY forget to put arguments for the first query. The default is set to empty array for first argument and true for second argument.

If you have done arranging the query, end it with getQuery() to make sure that you reach the end of query and ready to process to the next step.

The LiteGrabber is tested with PHPUnit.


All versions of litegrabber with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 aprillins/litegrabber contains the following files

Loading the files please wait ....