Download the PHP package cloudstudio/laravel-html-crawler without Composer

On this page you can find all versions of the php package cloudstudio/laravel-html-crawler. 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 laravel-html-crawler

Laravel HTML Crawler

A Laravel package for cleaning and transforming HTML content. It provides a fluent interface to remove unwanted elements like CSS, scripts, and more, with options to preserve specific elements and even convert the cleaned HTML to Markdown.

Features

Installation

Install the package using Composer:

The package will automatically register itself in Laravel.

To publish the configuration file, run:

Usage

1. Basic HTML Cleaning

By default, the package removes disallowed tags (for example, it will strip <div> tags and any tags not explicitly allowed):

2. Preserving Allowed Tags

You can explicitly specify which tags to preserve:

Using setAllowedTags

Using Helper Methods

The package offers helper methods to preserve groups of tags:

3. Handling Scripts

Removing <script> by Default

By default, <script> blocks are removed:

Preserving <script> with keepScripts()

If you wish to keep <script> blocks, use the keepScripts() method:

4. Handling CSS

By default, <style> blocks and CSS links are removed. To preserve them, use keepCss():

5. Using a Custom Regex Pattern

If you need to remove specific parts of the HTML using a regular expression:

6. Converting to Markdown

You can convert the cleaned HTML to Markdown:

7. Handling Newlines

Control how newlines are handled in the HTML:

8. Loading HTML from a URL

You can also load HTML directly from a URL:

Configuration

The package includes a configuration file that allows you to define default options. After publishing the configuration file, you will find it at config/html-crawler.php:

You can modify these values according to your needs.

Troubleshooting

If you encounter the error:

make sure your tests are running in a Laravel environment using orchestra/testbench. For package testing, install Testbench with:

Then, set up your base test case to extend Testbench (see the package documentation for more details).

Testing

To run the tests, you can use:

or if using PHPUnit:

Changelog

Please see the CHANGELOG for detailed information on recent changes.

Contributing

Please refer to CONTRIBUTING for details on how to contribute to this package.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-html-crawler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0
league/commonmark Version ^2.4
league/html-to-markdown Version ^5.1.1
spatie/laravel-package-tools Version ^1.14.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 cloudstudio/laravel-html-crawler contains the following files

Loading the files please wait ....