jeroenjanssens/data-science-at-the-command-line — pull request #21 by Nuttenscl (2014-10-30 15:36:38+00:00)
Title: Add 'attribute' option to scrape tool

The idea is to provide an "attribute" option to scrape tag's attribute value (not tag content itself).

Use case

With the many frontend libraries available now, we often encounter data embedded in a tag attribute, let's take the following test.html example:
```

Title

Some interesting content

Some other interesting content

Some interesting content

```
to extract the "data-entries" attribute value from the matching tags (having the specified attribute) , we can then use:
```
$ scrape -e ".interesting" -a "data-entries" test.html
{"entries":[{"id":1,"name":"thefirst"},{"id":2,"name":"thesecond"}]}
{"entries":[{"id":8,"name":"thetenth"}]}
```