Download the PHP package nizek/crawler without Composer

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

Selenium PHP Crawler

A PHP package to automate web crawling and element retrieval using Selenium WebDriver. This package allows you to connect to a Selenium server, navigate to web pages, and interact with elements by tags, classes, IDs, and CSS selectors. The package is set up for Chrome in headless mode, making it suitable for use in server environments.

Requirements

Using Docker

If you prefer to use Docker, a compatible Dockerfile can be found here. Simply run the following commands to build and start the Selenium server

After running these commands, you can access the Selenium server by opening http://localhost:4444 in your browser.

Usage

Initialization

To use the , instantiate it using the static method, which provides a preconfigured WebDriver instance connected to Selenium.

Setting the URL

To set the URL for the crawler to navigate to:

Methods

The following methods are provided for interacting with and retrieving elements from the webpage:

setUrl(string $url)

Sets the URL for the crawler to visit.

Parameters:
    $url: The URL to navigate to.
Returns:
    Returns the Crawler instance for method chaining.

Example:

parseXMLUrls()

Parses all URLs from XML content in tags. Useful for sitemaps.

Returns:
    An array of URLs found in <loc> tags on the page.

Example:

getElementByTagName(string $tagName)

Finds the first element with the given tag name.

Parameters:
    $tagName: The name of the tag to search for.
Returns:
    A WebElement object representing the element.

Example:

getElementsByTagName(string $tagName)

Finds all elements with the given tag name.

Parameters:
    $tagName: The name of the tag to search for.
Returns:
    An array of WebElement objects representing the elements.

Example:

getElementBySelector(string $selector)

Finds the first element with the given selector.

Parameters:
    $className: The name of the class to search for.
Returns:
    A WebElement object representing the element.

Example:

This will find all tags with class name with value equals (just like filtering page element)

getElementsBySelector(string $selector)

Finds all elements with the given selector.

Parameters:
    $className: The name of the class to search for.
Returns:
    An array of WebElement objects representing the elements.

Example:

getElementByClassName(string $className)

Finds the first element with the given class name.

Parameters:
    $className: The name of the class to search for.
Returns:
    A WebElement object representing the element.

Example:

getElementsByClassName(string $className)

Finds all elements with the given class name.

Parameters:
    $className: The name of the class to search for.
Returns:
    An array of WebElement objects representing the elements.

Example:

getElementById(string $id)

Finds the element with the given ID.

Parameters:
    $id: The ID of the element to search for.
Returns:
    A WebElement object representing the element.

Example:

getPageContent()

Retrieves the inner HTML content of the current page.

Returns:
    A string containing the inner HTML of the page.

Example:


All versions of crawler with dependencies

PHP Build Version
Package Version
No informations.
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 nizek/crawler contains the following files

Loading the files please wait ....