https://github.com/opportus/web-scraper
A web scraper taking as arguments a list of URLs and a list of XPath queries to perform on each document. Returns an instance of DataInterface.
https://github.com/opportus/web-scraper
csv json web-scraper web-scraping web-scrapper web-scrapping webscraper webscraping webscrapper webscrapping xpath
Last synced: about 1 year ago
JSON representation
A web scraper taking as arguments a list of URLs and a list of XPath queries to perform on each document. Returns an instance of DataInterface.
- Host: GitHub
- URL: https://github.com/opportus/web-scraper
- Owner: opportus
- License: mit
- Created: 2018-11-28T18:07:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-29T11:14:04.000Z (about 7 years ago)
- Last Synced: 2025-01-08T06:37:10.208Z (about 1 year ago)
- Topics: csv, json, web-scraper, web-scraping, web-scrapper, web-scrapping, webscraper, webscraping, webscrapper, webscrapping, xpath
- Language: PHP
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Web Scraper
A web scraper taking as arguments a list of URIs and a list of XPath queries to perform on each document. Returns an instance of [`DataInterface`](https://github.com/opportus/web-scraper/blob/master/src/DataInterface.php).
## Installation
```bash
$ composer require opportus/web-scraper
```
## Usage
```php
Use Opportus\WebScraper\WebScraper;
$uris = [
'https://en.wikipedia.org/wiki/Web_scraping',
'https://en.wikipedia.org/wiki/XPath',
];
$queries = [
'//p[1][node()]',
'//div[@id="mw-normal-catlinks"]/ul//li[node()]',
];
$scraper = new WebScraper();
$data = $scraper->scrap($uris, $queries); // @see https://github.com/opportus/web-scraper/blob/master/src/DataInterface.php
```