PHPackages                             florence/scrapa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. florence/scrapa

AbandonedArchivedLibrary

florence/scrapa
===============

A simple php web scraper package

v1.0(10y ago)6131MITPHP

Since Apr 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fokosun/webscrapa)[ Packagist](https://packagist.org/packages/florence/scrapa)[ RSS](/packages/florence-scrapa/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

\#WebScrapa

\###DISCLAIMER This package was put together for learning purposes only.

[![Build Status](https://camo.githubusercontent.com/576b46c7098c727005f4899b185550bbaf4ebc25491099f29ff0ee4aa68061ca/68747470733a2f2f7472617669732d63692e6f72672f666f6b6f73756e2f7765627363726170612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fokosun/webscrapa)

[![Coverage Status](https://camo.githubusercontent.com/7609710ed83761f0b9b0a6194c36c6371e3c370af3da98cef42c1832bba3be5d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e64656c612d666f6b6f73756e2f7765627363726170612f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/andela-fokosun/webscrapa?branch=master)

A simple PHP web scraper package -

Most websites do not offer the functionality to save a copy of the data which they display to your computer. The only option then is to manually copy and paste the data displayed by the website in your browser to a local file in your computer - a very tedious job which can take many hours or sometimes days to complete. Web Scraping is the technique of automating this process.

WebScrapa is a simple web scraper package written with PHP. It uses cURL to request and download a webpage. The downloaded webpage is converted to XML DOM object and XPath is used to navigate through elements in the XML DOM object.

\##Installation

```
composer require "florence/scrapa: v1.0"

```

\##Usage

- Create an instance of the Scrap class:

    ```
      $url = 'https://www.youtubecom/JustinBieber/about';
      $query = '//ul[@class="about-custom-links"]//a[@class="about-channel-link "]/@href';

      $scrap = new Scrap($url, $query);

    ```

Learn about XPath and how to scrape the elements based on their tags and attributes, such as CSS classes and IDs.

- Use the toArrayScrapDOM method to get the results of your query in array format

    ```
      print_r($scrap->toArrayScrapDOM());

    ```
- Use the toStringScrapDOM method to get the results of your query in string format

    ```
      print_r($scrap->toStringScrapDOM())

    ```

Run the example file
--------------------

[](#run-the-example-file)

clone the repo

```
git clone https://github.com/andela-fokosun/webscrapa

```

run

```
composer install

```

from your terminal, run:

```
php example.php

```

run tests

```
vendor/bin/phpunit

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3679d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a6cc40b038a8d47c9ce56d2f3fd2db84d4f4b606403e65c2087416663c05796?d=identicon)[florenxe](/maintainers/florenxe)

---

Top Contributors

[![fokosun](https://avatars.githubusercontent.com/u/7254731?v=4)](https://github.com/fokosun "fokosun (49 commits)")

---

Tags

phpTDDOOPweb-scraping PHPPackage

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/florence-scrapa/health.svg)

```
[![Health](https://phpackages.com/badges/florence-scrapa/health.svg)](https://phpackages.com/packages/florence-scrapa)
```

###  Alternatives

[letsdrink/ouzo-goodies

Utility classes, test assertions and mocking framework extracted from Ouzo framework.

132617.9k7](/packages/letsdrink-ouzo-goodies)[liip/drupalconnectormodule

The DrupalConnector Module is an abstraction layer to the Drupal 7 API of global functions in order to use them in an OOD setup.

121.7k3](/packages/liip-drupalconnectormodule)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
