Easily fetch, slice, dice, and output HTML content from remote pages in your CraftCMS templates.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scraper Added proper file headers. Added Release Feed and other 2.5-era plugi… Jul 7, 2016
README.md Updated readme. Jan 29, 2018

README.md

Scraper

Easily fetch, slice, dice, and output HTML content from remote pages.

Lovingly crafted by Top Shelf Craft
Michael Rog, Proprietor


tl;dr

Scraper allows you to easily fetch HTML content from any URL, create a DOM with it, select elements by CSS selector, find and manipulate DOM nodes, and save or output them using the power of Twig templates.

Usage

Use Scraper to query content from remote URLs, select it by HTML and CSS selector, and output it in your Craft templates.

For example:

{% set acmeContent = craft.scraper.get("http://acmewidgets.com") %}
{% for widgets in acmeContent.find(".widget") %}
        <div>{{ widget.innerText }}</div>
{% endfor %}

or...

{% set google = craft.scraper.get("http://google.com") %}
{% for link in google.find("a") %}
    <li>{{ link.attr.href }}</li>
{% endfor% }

What are the system requirements?

Craft 2.5+ and PHP 5.4+

I found a bug.

Nah...

I triple-checked. It's a bug.

Well, alright. Please open a GitHub Issue, submit a PR to the dev branch, or just email me to let me know.


Contributors: