Class: Aranha::Selenium::Session
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Aranha::Selenium::Session
- Defined in:
- lib/aranha/selenium/session.rb,
lib/aranha/selenium/session/find.rb,
lib/aranha/selenium/session/wait.rb,
lib/aranha/selenium/session/select.rb,
lib/aranha/selenium/session/downloads.rb,
lib/aranha/selenium/session/form_request.rb,
lib/aranha/selenium/session/form_request/field.rb
Defined Under Namespace
Modules: Find, Select, Wait Classes: Downloads, FormRequest
Instance Method Summary collapse
- #current_source ⇒ Object
- #downloads ⇒ Aranha::Selenium::Session::Downloads
-
#initialize(options = {}) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(options = {}) ⇒ Session
Returns a new instance of Session.
14 15 16 17 18 19 20 |
# File 'lib/aranha/selenium/session.rb', line 14 def initialize( = {}) super( ::Aranha::Selenium::DriverFactory.create_driver( .merge(::Aranha::Selenium::DriverOptions::OPTION_DOWNLOADS_DIR => downloads.dir) ) ) end |
Instance Method Details
#current_source ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/aranha/selenium/session.rb', line 22 def current_source element = find_element(xpath: '/html[1]') raise 'Root element not found' unless element s = element.attribute('innerHTML') "<html>\n#{s}\n</html>\n" end |