Skip to content

Releases: tamarasaurus/contract-scraper

v2.0.0

18 Apr 12:40
Compare
Choose a tag to compare

Improvements

  • Upgrade to puppeteer 3.0.0
  • Remove iconv
  • Remove request fetcher, always use puppeteer to fetch and encode page contents
  • Remove need for scrapeAfterLoading key

v1.0.12

04 Apr 15:38
Compare
Choose a tag to compare

Update the script tag provider to always parse an array of items

v1.0.11

22 Mar 08:21
Compare
Choose a tag to compare

Fix encoding issues by ignoring "windows-*" encoding types

v1.0.10

21 Mar 21:58
Compare
Choose a tag to compare

Allow scraping the innerHTML of elements

v1.0.9

21 Mar 17:10
354749a
Compare
Choose a tag to compare

Allow the use of the :eq selector in contracts

v1.0.8

14 Mar 15:54
Compare
Choose a tag to compare

This release adds the ability to scrape JSON inside script tags using a contract

v1.0.7

15 Jan 17:05
Compare
Choose a tag to compare

This release fixes a bug in the background-image attribute when parsing absolute urls.

v1.0.6

04 Jan 14:33
Compare
Choose a tag to compare

This release fixes a bug when converting windows-1252 encoding to utf-8.

v1.0.5

04 Jan 14:30
Compare
Choose a tag to compare

This version disables web security in the Puppeteer fetcher

v1.0.4

11 May 08:08
Compare
Choose a tag to compare

This version adds support for nested attributes, for example, scraping a nested list of items and returning them as an array:

<ul class="friends">
  <li>
    <span>Spiderman</span>
    <ul>
      <li><strong>Iron</strong><em>Man</em></li>
      <li><strong>Captain</strong><em>America</em></li>
    </ul>
  </li>
</ul>

The contract:

{
  "itemSelector": ".friends li",
  "attributes": {
    "name": { "type": "text", "selector": "span" },
    "friends": {
      "itemSelector": "ul li",
      "attributes": {
        "firstName": { "type": "text", "selector": "strong" },
        "lastName": { "type": "text", "selector": "em" }
      }
    }
  }
}

So this will return all the friends as an array:

[
  {
    name: 'Spiderman',
    friends: [
      { firstName: 'Iron', lastName: 'Man' },
      { firstName: 'Captain', lastName: 'America' },
    ]
  }
]