Class: Pumi::DataSource::Wikipedia::WebScraper
- Inherits:
-
Object
- Object
- Pumi::DataSource::Wikipedia::WebScraper
- Defined in:
- lib/pumi/data_source/wikipedia.rb
Defined Under Namespace
Classes: ElementNotFoundError
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ WebScraper
constructor
A new instance of WebScraper.
- #page ⇒ Object
Constructor Details
#initialize(url) ⇒ WebScraper
Returns a new instance of WebScraper.
51 52 53 |
# File 'lib/pumi/data_source/wikipedia.rb', line 51 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
49 50 51 |
# File 'lib/pumi/data_source/wikipedia.rb', line 49 def url @url end |
Instance Method Details
#page ⇒ Object
55 56 57 |
# File 'lib/pumi/data_source/wikipedia.rb', line 55 def page @page ||= Nokogiri::HTML(URI.parse(url).open) end |