Class: Nicos::Searcher::ByTagHtml
- Inherits:
-
ByTagSuper
- Object
- Connector::Config
- ByTagSuper
- Nicos::Searcher::ByTagHtml
- Defined in:
- lib/classes/searcher.rb
Instance Attribute Summary collapse
-
#waitConfig ⇒ Object
Returns the value of attribute waitConfig.
Instance Method Summary collapse
- #execute(tag, sortMethod, &block) ⇒ Object
-
#initialize ⇒ ByTagHtml
constructor
A new instance of ByTagHtml.
Methods included from Connector::SetWait
Methods inherited from Connector::Config
Constructor Details
#initialize ⇒ ByTagHtml
Returns a new instance of ByTagHtml.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/classes/searcher.rb', line 94 def initialize @numOfSearched = 32 @incrAmt = 0.2 @connector = Nicos::Connector.new(:mech) # HTML中の各パラメータの所在を示すXPath @videoIdXP = "//div[@class='uad_thumbfrm']/table/tr/td/p/a" @lengthXP = "//div[@class='uad_thumbfrm']/table/tr/td/p[2]/span" @viewXP = "//div[@class='uad_thumbfrm']/table/tr/td[2]/div/nobr[1]/strong" @resXP = "//div[@class='uad_thumbfrm']/table/tr/td[2]/div/nobr[2]/strong" @mylistXP = "//div[@class='uad_thumbfrm']/table/tr/td[2]/div/nobr[3]/a/strong" @adXP = "//div[@class='uad_thumbfrm']/table/tr/td[2]/div/nobr[4]/a/strong" @waitConfig = @@waitConfig end |
Instance Attribute Details
#waitConfig ⇒ Object
Returns the value of attribute waitConfig.
109 110 111 |
# File 'lib/classes/searcher.rb', line 109 def waitConfig @waitConfig end |
Instance Method Details
#execute(tag, sortMethod, &block) ⇒ Object
143 144 145 146 147 |
# File 'lib/classes/searcher.rb', line 143 def execute(tag, sortMethod, &block) loop(tag, sort, :mech) { |result, page| block.call(result, page) } end |