ELEMENT_EXISTS

Source

ELEMENT_EXISTS returns a boolean value indicating whether there is an element matched by selector.

Argument Type Description
docOrEl HTMLDocument HTMLNode Parent document or element.
selector String Css selector.

Returns Boolean A boolean value indicating whether there is an element matched by selector.


BLUR

Source

BLUR Calls blur on the element.

Argument Type Description
target HTMLPage HTMLDocument HTMLElement Target node.
selector String, optional Optional css selector.

Returns None


INNER_TEXT_ALL

Source

INNER_TEXT_ALL returns an array of inner text of matched elements.

Argument Type Description
doc HTMLDocument HTMLElement Parent document or element.
selector String String of css selector.

Returns String An array of inner text if any element found, otherwise empty array.


ELEMENTS

Source

ELEMENTS finds HTML elements by a given CSS selector. Returns an empty array if element not found.

Argument Type Description
docOrEl HTMLDocument HTMLNode Parent document or element.
selector String Css selector.

Returns Array Returns an array of found html element.


WAIT_ELEMENT

Source

WAIT_ELEMENT waits for element to appear in the DOM. Stops the execution until it finds an element or operation times out.

Argument Type Description
false HTMLDocument Driver htmldocument.
selector String Target element’s selector.
timeout Int, optional Optional timeout. default 5000 ms.

Returns None


WAIT_NO_ELEMENT

Source

WAIT_NO_ELEMENT waits for element to disappear in the DOM. Stops the execution until it does not find an element or operation times out.

Argument Type Description
doc HTMLDocument Driver htmldocument.
selector String Target element’s selector.
timeout Int, optional Optional timeout. default 5000 ms.

Returns None


Source

NAVIGATE_BACK navigates a given page back within its navigation history. The operation blocks the execution until the page gets loaded. If the history is empty, the function returns FALSE.

Argument Type Description
page HTMLPage Target page.
entry Int, optional Optional value indicating how many pages to skip. default 1.
timeout Int, optional Optional timeout. default is 5000.

Returns Boolean Returns true if history exists and the operation succeeded, otherwise false.


INPUT_CLEAR

Source

INPUT_CLEAR clears a value from an underlying input element.

Argument Type Description
source HTMLPage HTMLDocument HTMLElement Event target.
selector String, options Selector.

Returns None


SELECT

Source

SELECT selects a value from an underlying select element.

Argument Type Description
source Open GetElement Event target.
valueOrSelector String Array<String> Selector or a an array of strings as a value.
value Array<String Target value. optional.

Returns Array<String> Returns an array of selected values.


WAIT_NAVIGATION

Source

WAIT_NAVIGATION waits for a given page to navigate to a new url. Stops the execution until the navigation ends or operation times out.

Argument Type Description
page HTMLPage Target page.
timeout Int, optional Optional timeout. default 5000 ms.

Returns None


PDF

Source

PDF prints a PDF of the current page.

Argument Type Description
target HTMLPage String Target page or url.
params (Object) - Optional, An object containing the following properties : Landscape (Bool) - Paper orientation. Defaults to false. DisplayHeaderFooter (Bool) - Display header and footer. Defaults to false. PrintBackground (Bool) - Print background graphics. Defaults to false. Scale (Float64) - Scale of the webpage rendering. Defaults to 1. PaperWidth (Float64) - Paper width in inches. Defaults to 8.5 inches. PaperHeight (Float64) - Paper height in inches. Defaults to 11 inches. MarginTop (Float64) - Top margin in inches. Defaults to 1cm (~0.4 inches). MarginBottom (Float64) - Bottom margin in inches. Defaults to 1cm (~0.4 inches). MarginLeft (Float64) - Left margin in inches. Defaults to 1cm (~0.4 inches). MarginRight (Float64) - Right margin in inches. Defaults to 1cm (~0.4 inches). PageRanges (String) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. IgnoreInvalidPageRanges (Bool) - to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false. HeaderTemplate (String) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - date: formatted print date - title: document title - url: document location - pageNumber: current page number - totalPages: total pages in the document For example, would generate span containing the title. FooterTemplate (String) - HTML template for the print footer. Should use the same format as theheaderTemplate. PreferCSSPageSize Bool Whether or not to prefer page size as defined by css. defaults to false, in which case the content will be scaled to fit the paper size. *

Returns Binary Returns a base64 encoded string in binary format.


PAGINATION

Source

PAGINATION creates an iterator that goes through pages using CSS selector. The iterator starts from the current page i.e. it does not change the page on 1st iteration. That allows you to keep scraping logic inside FOR loop.

Argument Type Description
doc Open Target document.
selector String Css selector for a pagination on the page.

Returns None


STYLE_GET

Source

STYLE_GET gets single or more style attribute value(s) of a given element.

Argument Type Description
el HTMLElement Target element.
names ...String Style name(s).

Returns Object Key-value pairs of style values.


SCROLL

Source

SCROLL scrolls by given coordinates.

Argument Type Description
doc HTMLDocument Html document.
x Int Float X coordinate.
true Int Float Y coordinate.
options ScrollOptions Scroll options. optional.

Returns None


ATTR_REMOVE

Source

ATTR_REMOVE removes single or more attribute(s) of a given element.

Argument Type Description
el HTMLElement Target element.
names ...String Attribute name(s).

Returns None


ATTR_SET

Source

ATTR_SET sets or updates a single or more attribute(s) of a given element.

Argument Type Description
el HTMLElement Target element.
nameOrObj String Object Attribute name or an object representing a key-value pair of attributes.
value String If a second parameter is a string value, this parameter represent an attribute value.

Returns None


WAIT_STYLE

Source

WAIT_STYLE

Argument Type Description

Returns None


WAIT_NO_STYLE

Source

WAIT_NO_STYLE

Argument Type Description

Returns None


WAIT_ATTR_ALL

Source

WAIT_ATTR_ALL waits for an attribute to appear on all matched elements with a given value. Stops the execution until the navigation ends or operation times out.

Argument Type Description
doc HTMLDocument Parent document.
selector String String of css selector.
class String String of target css class.
timeout Int, optional Optional timeout.

Returns None


WAIT_NO_ATTR_ALL

Source

WAIT_NO_ATTR_ALL waits for an attribute to disappear on all matched elements by a given value. Stops the execution until the navigation ends or operation times out.

Argument Type Description
doc HTMLDocument Parent document.
selector String String of css selector.
class String String of target css class.
timeout Int, optional Optional timeout.

Returns None


Source

COOKIE_DEL gets a cookie from a given page by name.

Argument Type Description
page HTMLPage Target page.
cookie ...HTTPCookie String Cookie or cookie name to delete.

Returns None


HOVER

Source

HOVER fetches an element with selector, scrolls it into view if needed, and then uses page.mouse to hover over the center of the element. If there’s no element matching selector, the method returns an error.

Argument Type Description
docOrEl HTMLDocument HTMLElement Target document or element.
selector String, options If document is passed, this param must represent an element selector.

Returns None


INNER_HTML

Source

INNER_HTML returns inner HTML string of a given or matched by CSS selector element

Argument Type Description
doc Open GetElement Parent document or element.
selector String, optional String of css selector.

Returns String Inner html string if an element found, otherwise empty string.


INNER_HTML_SET

Source

INNER_HTML_SET sets inner HTML string to a given or matched by CSS selector element

Argument Type Description
doc Open GetElement Parent document or element.
selector String, optional String of css selector.
innerHTML String String of inner html.

Returns None


ELEMENTS_COUNT

Source

ELEMENTS_COUNT returns a number of found HTML elements by a given CSS selector. Returns an empty array if element not found.

Argument Type Description
docOrEl HTMLDocument HTMLNode Parent document or element.
selector String Css selector.

Returns Int A number of found html elements by a given css selector.


Source

NAVIGATE_FORWARD navigates a given page forward within its navigation history. The operation blocks the execution until the page gets loaded. If the history is empty, the function returns FALSE.

Argument Type Description
page HTMLPage Target page.
entry Int, optional Optional value indicating how many pages to skip. default 1.
timeout Int, optional Optional timeout. default is 5000.

Returns Boolean Returns true if history exists and the operation succeeded, otherwise false.


MOUSE

Source

MOUSE moves mouse by given coordinates.

Argument Type Description
doc HTMLDocument Html document.
x Int Float X coordinate.
true Int Float Y coordinate.

Returns None


SCREENSHOT

Source

SCREENSHOT takes a screenshot of a given page.

Argument Type Description
target HTMLPage String Target page or url.
params (Object) - Optional, An object containing the following properties : x (Float|Int) - Optional, X position of the viewport. x (Float|Int) - Optional,Y position of the viewport. width (Float|Int) - Optional, Width of the viewport. height (Float|Int) - Optional, Height of the viewport. format (String) - Optional, Either "jpeg" or "png". quality Int Optional, quality, in [0, 100], only for jpeg format.

Returns Binary Returns a base64 encoded string in binary format.


STYLE_REMOVE

Source

STYLE_REMOVE removes single or more style attribute value(s) of a given element.

Argument Type Description
el HTMLElement Target element.
names ...String Style name(s).

Returns None


WAIT_CLASS

Source

WAIT_CLASS waits for a class to appear on a given element. Stops the execution until the navigation ends or operation times out.

Argument Type Description
node HTMLPage HTMLDocument HTMLElement Target node.
selectorOrClass String If document is passed, this param must represent an element selector. otherwise target class.
classOrTimeout String Int, optional If document is passed, this param must represent target class name. otherwise timeout.
timeout Int, optional If document is passed, this param must represent timeout. otherwise not passed.

Returns None


WAIT_NO_CLASS

Source

WAIT_NO_CLASS waits for a class to disappear on a given element. Stops the execution until the navigation ends or operation times out.

Argument Type Description
node HTMLPage HTMLDocument HTMLElement Target node.
selectorOrClass String If document is passed, this param must represent an element selector. otherwise target class.
classOrTimeout String Int, optional If document is passed, this param must represent target class name. otherwise timeout.
timeout Int, optional If document is passed, this param must represent timeout. otherwise not passed.

Returns None


SCROLL_TOP

Source

SCROLL_TOP scrolls the document’s window to its top.

Argument Type Description
doc HTMLDocument Target document.
options ScrollOptions Scroll options. optional.

Returns None


INNER_TEXT

Source

INNER_TEXT returns inner text string of a given or matched by CSS selector element

Argument Type Description
doc HTMLDocument HTMLElement Parent document or element.
selector String, optional String of css selector.

Returns String Inner text if an element found, otherwise empty string.


ATTR_GET

Source

ATTR_GET gets single or more attribute(s) of a given element.

Argument Type Description
el HTMLElement Target element.
names ...String Attribute name(s).

Returns Object Key-value pairs of attribute values.


FOCUS

Source

FOCUS Sets focus on the element.

Argument Type Description
target HTMLPage HTMLDocument HTMLElement Target node.
selector String, optional Optional css selector.

Returns None


INNER_HTML_ALL

Source

INNER_HTML_ALL returns an array of inner HTML strings of matched elements.

Argument Type Description
doc HTMLDocument HTMLElement Parent document or element.
selector String String of css selector.

Returns String An array of inner html strings if any element found, otherwise empty array.


SCROLL_BOTTOM

Source

SCROLL_BOTTOM scrolls the document’s window to its bottom.

Argument Type Description
doc HTMLDocument Target document.
options ScrollOptions Scroll options. optional.

Returns None


Source

COOKIE_SET sets cookies to a given page

Argument Type Description
page HTMLPage Target page.
cookie... HTTPCookie Target cookies.

Returns None


WAIT_CLASS_ALL

Source

WAIT_CLASS_ALL waits for a class to appear on all matched elements. Stops the execution until the navigation ends or operation times out.

Argument Type Description
doc HTMLDocument Parent document.
selector String String of css selector.
class String String of target css class.
timeout Int, optional Optional timeout.

Returns None


WAIT_NO_CLASS_ALL

Source

WAIT_NO_CLASS_ALL waits for a class to disappear on all matched elements. Stops the execution until the navigation ends or operation times out.

Argument Type Description
doc HTMLDocument Parent document.
selector String String of css selector.
class String String of target css class.
timeout Int, optional Optional timeout.

Returns None


WAIT_STYLE_ALL

Source

WAIT_STYLE_ALL

Argument Type Description

Returns None


WAIT_NO_STYLE_ALL

Source

WAIT_NO_STYLE_ALL

Argument Type Description

Returns None


Source

COOKIE_GET gets a cookie from a given page by name.

Argument Type Description
page HTMLPage Target page.
name String Cookie or cookie name to delete.

Returns None


XPATH

Source

XPATH evaluates the XPath expression.

Argument Type Description
source HTMLPage HTMLDocument HTMLElement Target html object.
expression String Xpath expression.

Returns Value Returns result of a given xpath expression.


PARSE

Source

PARSE loads an HTML page from a given string or byte array

Argument Type Description
params (Object) - Optional, an object containing the following properties : driver (String) - Optional, driver name. keepCookies (Boolean) - Optional, boolean value indicating whether to use cookies from previous sessions. i.e. not to open a page in the Incognito mode. cookies (HTTPCookies) - Optional, set of HTTP cookies. headers (HTTPHeaders) - Optional, HTTP headers. viewport Viewport Optional, viewport params.

Returns HTMLPage Returns parsed and loaded html page.


INNER_TEXT_SET

Source

INNER_TEXT_SET sets inner text string to a given or matched by CSS selector element

Argument Type Description
doc Open GetElement Parent document or element.
selector String, optional String of css selector.
innerText String String of inner text.

Returns None


ELEMENT

Source

ELEMENT finds an element by a given CSS selector. Returns NONE if element not found.

Argument Type Description
docOrEl HTMLDocument HTMLElement Parent document or element.
selector String Css selector.

Returns HTMLElement None Returns an htmlelement if found, otherwise none.


CLICK

Source

CLICK dispatches click event on a given element

Argument Type Description
source Open GetElement Event source.
selectorOrCount String Int, optional Optional selector or count of clicks.
count Int, optional Optional count of clicks.

Returns None


CLICK_ALL

Source

CLICK_ALL dispatches click event on all matched element

Argument Type Description
source Open Open.
selector String Selector.
count Int, optional Optional count of clicks.

Returns Boolean Returns true if matched at least one element.


DOWNLOAD

Source

Download downloads a resource from the given GetURL.

Argument Type Description
GetURL String Geturl to download.

Returns Binary Returns a base64 encoded string in binary format.


INPUT

Source

INPUT types a value to an underlying input element.

Argument Type Description
source HTMLPage HTMLDocument HTMLElement Event target.
valueOrSelector String Selector or a value.
value String Target value.
delay Int, optional Target value.

Returns Boolean Returns true if an element was found.


Source

NAVIGATE navigates a given page to a new resource. The operation blocks the execution until the page gets loaded. Which means there is no need in WAIT_NAVIGATION function.

Argument Type Description
page HTMLPage Target page.
url String Target url to navigate.
timeout Int, optional Optional timeout. default is 5000.

Returns None


STYLE_SET

Source

STYLE_SET sets or updates a single or more style attribute value of a given element.

Argument Type Description
el HTMLElement Target element.
nameOrObj String Object Style name or an object representing a key-value pair of attributes.
value String If a second parameter is a string value, this parameter represent a style value.

Returns None


WAIT_ATTR

Source

WAIT_ATTR waits until a target attribute’s value appears

Argument Type Description
node HTMLPage HTMLDocument HTMLElement Parent document.
attrNameOrSelector String String of an attr name or css selector.
attrValueOrAttrName String Any Attr value or name.
attrValueOrTimeout Any Int, optional Attr value or an optional timeout.
timeout Int, optional Optional timeout.

Returns None


WAIT_NO_ATTR

Source

WAIT_NO_ATTR waits until a target attribute’s value disappears

Argument Type Description
node HTMLPage HTMLDocument HTMLElement Parent document.
attrNameOrSelector String String of an attr name or css selector.
attrValueOrAttrName String Any Attr value or name.
attrValueOrTimeout Any Int, optional Attr value or an optional timeout.
timeout Int, optional Optional timeout.

Returns None


DOCUMENT

Source

DOCUMENT opens an HTML page by a given url. By default, loads a page by http call - resulted page does not support any interactions.

Argument Type Description
params (Object) - Optional, An object containing the following properties : driver (String) - Optional, driver name. timeout (Int) - Optional, timeout. userAgent (String) - Optional, user agent. keepCookies (Boolean) - Optional, boolean value indicating whether to use cookies from previous sessions. i.e. not to open a page in the Incognito mode. cookies (HTTPCookies) - Optional, set of HTTP cookies. headers (HTTPHeaders) - Optional, HTTP headers. viewport Viewport Optional, viewport params.

Returns HTMLPage Returns loaded html page.


SCROLL_ELEMENT

Source

SCROLL_ELEMENT scrolls an element on.

Argument Type Description
docOrEl HTMLDocument HTMLElement Target document or element.
selector String If document is passed, this param must represent an element selector.
options ScrollOptions Scroll options. optional.

Returns None