Class: SeoCache::PageRender
- Inherits:
-
Object
- Object
- SeoCache::PageRender
- Defined in:
- lib/seo_cache/page_render.rb
Instance Method Summary collapse
- #close_connection ⇒ Object
- #get(url, quit_after_render = true) ⇒ Object
-
#initialize ⇒ PageRender
constructor
A new instance of PageRender.
Constructor Details
#initialize ⇒ PageRender
Returns a new instance of PageRender.
5 6 7 |
# File 'lib/seo_cache/page_render.rb', line 5 def initialize init_driver end |
Instance Method Details
#close_connection ⇒ Object
23 24 25 |
# File 'lib/seo_cache/page_render.rb', line 23 def close_connection @driver&.quit end |
#get(url, quit_after_render = true) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/seo_cache/page_render.rb', line 9 def get(url, quit_after_render = true) @driver.get(url) sleep SeoCache.wait_time_for_page_loading if SeoCache.wait_time_for_page_loading return @driver.page_source rescue StandardError => error SeoCache.log_error(error.) return false ensure @driver&.quit if quit_after_render end |