Class: Playwright::Selectors

Inherits:
PlaywrightApi show all
Defined in:
lib/playwright_api/selectors.rb

Overview

Selectors can be used to install custom selector engines. See [Working with selectors](./selectors.md) for more information.

Instance Method Summary collapse

Methods inherited from PlaywrightApi

#initialize, wrap

Constructor Details

This class inherits a constructor from Playwright::PlaywrightApi

Instance Method Details

#off(event, callback) ⇒ Object

– inherited from EventEmitter –



23
24
25
# File 'lib/playwright_api/selectors.rb', line 23

def off(event, callback)
  event_emitter_proxy.off(event, callback)
end

#on(event, callback) ⇒ Object

– inherited from EventEmitter –



17
18
19
# File 'lib/playwright_api/selectors.rb', line 17

def on(event, callback)
  event_emitter_proxy.on(event, callback)
end

#once(event, callback) ⇒ Object

– inherited from EventEmitter –



29
30
31
# File 'lib/playwright_api/selectors.rb', line 29

def once(event, callback)
  event_emitter_proxy.once(event, callback)
end

#register(name, contentScript: nil, path: nil, script: nil) ⇒ Object

An example of registering selector engine that queries elements based on a tag name:

“‘python sync # FIXME: add snippet “`



11
12
13
# File 'lib/playwright_api/selectors.rb', line 11

def register(name, contentScript: nil, path: nil, script: nil)
  wrap_impl(@impl.register(unwrap_impl(name), contentScript: unwrap_impl(contentScript), path: unwrap_impl(path), script: unwrap_impl(script)))
end