Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

maiha-css_parser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maiha-css_parser

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

css_parser

hpricot helper that scrapes html easily by parser class defined css selector

Example

class UserParser < CssParser css :name, "div#contents span.name" css :age , "div#contents span.age" end

parser = UserParser.file('user.html') User.new parser.attributes

Formatter

"css" accepts :as option to specify output format. Let's consider following html.

Maiha (maiha)

When the case of :html formatter, this is in default.

class UserParser < CssParser css :name, "span.name" end

UserParser.new(html).name

=> "Maiha\n<span class="nick">(maiha)"

When the case of :text formatter.

class UserParser < CssParser css :name, "span.name", :as=>:text end

UserParser.new(html).name

=> "Maiha\n (maiha)"

Copyright (c) 2008 maiha@wota.jp, released under the MIT license

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc