The Hpricot Book
Basic Recipes
- Scraping a single element.
- Getting a group of elements.
- And: a range of elements.
- Deep-searching (piggybacking searches.)
CSS Recipes
- Getting an element by ID: #id
- Getting an element by class name: .class
- Elements of the same tag: div
- How do these selectors combine: div.class or div.class.also
- Elements inside elements: div p
- Direct children of elements: div > p
- Finding text: div > text()
- Matching attributes: link[@rel="stylesheet"]
Common Problems
- Buffer size error: Hpricot.buffer_size = 6 * 1024 * 1024
- Why you don't see parse errors.
Download in other formats: