husc 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8d3839225b1c0ae71db2371b3858620ac34408c0a209739dbe96e1683437a6f
4
- data.tar.gz: 4effb7652a7d0121b835e4ac8f8255305c9eb078ee7acaa245dccd19c819843b
3
+ metadata.gz: 7af45196d951b1df90c5d23a9c3d82aca78c26b19174573f145e177232adfcf2
4
+ data.tar.gz: 97f4ebeda8e93eee056359d317bc67401049d8dc5d83b8f2249c66523b558905
5
5
  SHA512:
6
- metadata.gz: 29d4486ab7cf5de9fb3e757b0b495ac9fbcd88ed389d6696f04a42a8b4e6dfbb841e2435afb3af996d883bcde8ecdca9dde9911be20a7b36cf4009dea4dbdec8
7
- data.tar.gz: be53729a52309e9b4dbc36cd82673e0d4f20ba8d9631390776a65c5fe623b6395b03636cffa498c4aed1df8cacd767d0ed6435a2f527cd393b68b4b7694c82f1
6
+ metadata.gz: 7c18dae28174ca670a243b1b067e1d320ba7938b1f70b86aaafe15d819223d109d6360197dfc2ad8349dee2ba30baefce0db55600f9e67410df032dd37251c77
7
+ data.tar.gz: d67ccef3d4bb088d7c6910f2dea68d2e5bbeb72cac66ec2e31372e29bfd1a591f7a98c1dfa86ff8f68aa3bb69a38407218e6c3655f772747415067e10d3c0322
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- husc (0.1.1)
4
+ husc (0.2.0)
5
5
  mechanize
6
6
  nokogiri
7
7
 
data/README.md CHANGED
@@ -14,6 +14,16 @@ This project enables site crawling and data extraction with xpath and css select
14
14
 
15
15
 
16
16
  ## Usage
17
+ ### Description of Instance Methods
18
+ name | Description
19
+ -----------|----------------------------------------------
20
+ send | Set the value you want to submit to the form.
21
+ submit | Submit form.
22
+ css | Get node by css selector.
23
+ xpath | Get node by xpath.
24
+ attr | Get node's attribute.
25
+ inner_text | Get node's inner text.
26
+
17
27
  ### Simple Example
18
28
  ```ruby
19
29
  require 'husc'
@@ -158,6 +158,15 @@ class Husc
158
158
  end
159
159
  end
160
160
 
161
+ def inner_html(shaping = true)
162
+ ## -----*----- タグ内のHTMLを取得 -----*----- ##
163
+ if shaping
164
+ return shaping_string(@doc.inner_html)
165
+ else
166
+ @doc.inner_html
167
+ end
168
+ end
169
+
161
170
  def text(shaping = true)
162
171
  ## -----*----- タグ内の文字列(その他タグ除去)を取得 -----*----- ##
163
172
  if shaping
@@ -183,6 +192,7 @@ class Husc
183
192
 
184
193
  def update_params(html)
185
194
  ## -----*----- パラメータを更新 -----*----- ##
195
+ @url = @agent.page.uri
186
196
  @html = html
187
197
  @doc = Nokogiri::HTML.parse(@html)
188
198
  table_to_hash
@@ -1,3 +1,3 @@
1
1
  class Husc
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: husc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Abe