Class: RulethuStockExchange::Scraper
- Inherits:
-
Object
- Object
- RulethuStockExchange::Scraper
- Defined in:
- lib/rulethu_stock_exchange/scraper.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ Scraper
constructor
A new instance of Scraper.
- #scrape(selector) ⇒ Object
Constructor Details
#initialize(url) ⇒ Scraper
Returns a new instance of Scraper.
6 7 8 9 |
# File 'lib/rulethu_stock_exchange/scraper.rb', line 6 def initialize(url) @url = url @driver = setup_driver end |
Instance Method Details
#scrape(selector) ⇒ Object
11 12 13 14 15 |
# File 'lib/rulethu_stock_exchange/scraper.rb', line 11 def scrape(selector) @driver.navigate.to(@url) sleep 5 @driver.find_element :css, selector end |