Exception: Puppeteer::DOMWorld::ElementNotFoundError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/puppeteer/dom_world.rb

Overview

/**

 * @param {string} content
 * @return {!Promise<!HTMLElement>}
 */
async function addStyleContent(content) {
  const style = document.createElement('style');
  style.type = 'text/css';
  style.appendChild(document.createTextNode(content));
  const promise = new Promise((res, rej) => {
    style.onload = res;
    style.onerror = rej;
  });
  document.head.appendChild(style);
  await promise;
  return style;
}

}

Instance Method Summary collapse

Constructor Details

#initialize(selector) ⇒ ElementNotFoundError

Returns a new instance of ElementNotFoundError.



373
374
375
# File 'lib/puppeteer/dom_world.rb', line 373

def initialize(selector)
  super("No node found for selector: #{selector}")
end