Download the PHP package rgasch/autoscraper without Composer

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

AutoScraper

  1. [ ] **_AutoScraper is a PHP class designed to scrape web pages and extract data based on predefined rules.
  2. [ ] This README provides examples of how to use the class to capture a scraping definition and then reuse
  3. [ ] this definition to scrape other similar pages._**

AutoScraper is a port of the Python AutoScraper library by Alireza Mika. It is intended to be compatible in its public API, but it contains some additions and changes to better fit the PHP ecosystem.

Installation

To install the AutoScraper class, use Composer:

Usage

Capturing a Scraping Definition To capture a scraping definition, you need to provide a URL and a wishlist of items you want to scrape from the page

Reusing the Scraping Definition

Once you have captured and saved a scraping definition, you can reuse it to scrape other similar pages.

Methods

Captures a scraping definition based on the provided URL and wishlist.

Saves the captured scraping definition to a file.

`

Loads a previously saved scraping definition from a file.

`

Scrapes a page using the loaded scraping definition and returns the extracted data.

Returns the CSS selector after you have loaded a previously saved scraping definition.

Test Commands

There are two tests commands that you can refer to in order to see actual use cases and to interactively test the AutoScraper class. These commands are:

This file prompts you for a URL and the text you wish to scrape and then saves the resulting CSS selector definitions into a JSON file into the resource directory.

This file allows you to re-use a previously saved CSS selector definition to scrape a new URL.

Tutorials

Refer to this gist for some advanced use cases and tutorials on how to use the AutoScraper class. This gist is (of course) based on the Python library, but it should illustrate how to use the PHP version as well.

Disclaimer: I have written some tests to verify the correctness of the PHP Library, but certainly haven't covered all areas of the functionality. It should work, but no guarantees are given. Besides, this is open source, so you know what that means (hint: pull requests are welcome).

License

This project is licensed under the MIT License.


All versions of autoscraper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/browser-kit Version ^7.2
symfony/dom-crawler Version ^7.2
symfony/http-client Version ^7.2
thecodingmachine/safe Version ^3.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 rgasch/autoscraper contains the following files

Loading the files please wait ....