@@ -6,6 +6,8 @@ NokogiriはHTMLを解析するためのライブラリです。Hpricotと互換性があります。 +libxml2を使っています。 + ! 機能 :[[Nokogiri/search]]: XML/HTML要素の検索 :[[Nokogiri/Node]]: XML/HTMLノードに対する操作
スクレイピングのチュートリアルを書いてみた。 参考:http://nokogiri.rubyforge.org/nokogiri/Nokogiri.html まだまだたくさんのクラスやメソッドがあるが(読んでない)、HTMLのスクレイピングに限定すれば多分これくらいで十分。 2014-02-16追記 なんかたくさんブックマークされていることに気づいたので、サンプルコードのRuby1.9/2対応のアップデート。 Mechanize周りも修正。WWW::Mechanize → Mechanize 等 (0) 前提知識 Ruby、HTML、DOM、CSSセレクタまたはXPath (1) クラス構造の理解 Nokogiri::HTML::Document < Nokogiri::XML::Document < Nokogiri::XML::Node < Object Nokogiri::XML::
『るびま』は、Ruby に関する技術記事はもちろんのこと、Rubyist へのインタビューやエッセイ、その他をお届けするウェブ雑誌です。 Rubyist Magazine について 『Rubyist Magazine』、略して『るびま』は、日本 Ruby の会の有志による Rubyist の Rubyist による、Rubyist とそうでない人のためのウェブ雑誌です。 最新号 Rubyist Magazine 0058 号 バックナンバー Rubyist Magazine 0058 号 RubyKaigi 2018 直前特集号 Rubyist Magazine 0057 号 RubyKaigi 2017 直前特集号 Rubyist Magazine 0056 号 Rubyist Magazine 0055 号 Rubyist Magazine 0054 号 東京 Ruby 会議 11 直
この記事は5/23に掲載された「A HTML5 Primer for the Overwhelmed」を訳したものです HTML5がグーグルやアップルにより、リッチインターネットアプリケーション(RIA)のためのソリューションとして強力にサポートされ始めた結果、HTML5という言葉がバスワード化しています(特にGoogle I/O以降)。そして、HTML5という言葉が広く流布するにしたがって、その言葉本来の意味とは違う意味で使われ始めていることも、驚きではなくなっています。「HTML5の経験があること」が採用条件となっているような採用情報も既に存在しますし、シンプルなJavaScriptアニメーションもCSS3によるアニメーションもひっくるめてHTML5のサンプルとして紹介されていたりします。 ちょうど00年代中頃に「次世代のWeb開発」を指すバズワードとして「AJAX」や「Web2.0」
Hpricot RubyでHTMLを解析するためのライブラリHpricotの使い方まとめです。 書きかけです。 AnHPricotShowcaseを ベースにしていますが、改変したり省略している箇所も結構あります。 Basics ライブラリのロード HTMLを開く(Hpricot) 要素を探す(search, /) 要素を一つだけ探す 要素の中身のHTMLを得る(inner_html) 要素のタグを含めたHTMLを得る(to_html) 繰り返し(Elements#each) 要素の中を検索する(search, /) HTMLを編集する(set) 要素のパス名を得る(css_path, xpath) Elements 複数の要素の中を検索する Elements#at( expression, &block ) Elements#search( expression, &block ) 複数
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く