ATTR_GET

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target node.
attrNames String, repeated Attribute name(s).

Returns Object Key-value pairs of attribute values.


ATTR_REMOVE

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target node.
attrNames String, repeated 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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target node.
nameOrObj - Attribute name or an object representing a key String Object Value pair of attributes.
value String If a second parameter is a string value, this parameter represent an attribute value.

Returns None


BLUR

Source

BLUR Calls blur on the element.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target node.
selector String Css selector.

Returns None


CLICK

Source

CLICK dispatches click event on a given element

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
cssSelectorOrClicks String Int Css selector or count of clicks.
clicks Int 1 Count of clicks.

Returns None


CLICK_ALL

Source

CLICK_ALL dispatches click event on all matched element

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.
clicks Int 1 Optional count of clicks.

Returns Boolean True if matched at least one element.


Source

COOKIE_DEL gets a cookie from a given page by name.

Argument Type Default value Description
page HTMLPage Target page.
cookiesOrNames HTTPCookie, repeated String, repeated Cookie or cookie name to delete.

Returns None


Source

COOKIE_GET gets a cookie from a given page by name.

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

Returns HTTPCookie Cookie if found, otherwise none.


Source

COOKIE_SET sets cookies to a given page

Argument Type Default value Description
page HTMLPage Target page.
cookies HTTPCookie, repeated Target cookies.

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 Default value Description
params Object An object containing the following properties :
params.driver String Driver name to use.
params.timeout Int 60000 Page load timeout.
params.userAgent String Custom user agent.
params.keepCookies Boolean False Boolean value indicating whether to use cookies from previous sessions i.e. not to open a page in the incognito mode.
params.cookies HTTPCookies Set of http cookies to use during page loading.
params.headers HTTPHeaders Set of http headers to use during page loading.
params.viewport Object Viewport params.
params.viewport.height Int Viewport height.
params.viewport.width Int Viewport width.
params.viewport.scaleFactor Float Viewport scale factor.
params.viewport.mobile Boolean Value that indicates whether to emulate mobile device.
params.viewport.landscape Boolean Value that indicates whether to render a page in landscape position.

Returns HTMLPage Loaded html page.


DOWNLOAD

Source

DOWNLOAD downloads a resource from the given GetURL.

Argument Type Default value Description
url String Url to download.

Returns Binary A base64 encoded string in binary format.


ELEMENT

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

Returns HTMLElement A matched html element


ELEMENTS

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

Returns HTMLElement[] An array of matched html elements.


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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

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


ELEMENT_EXISTS

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

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


FOCUS

Source

FOCUS Sets focus on the element.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

Returns None


FRAMES

Source

FRAMES finds HTML frames by a given property selector. Returns an empty array if frames not found.

Argument Type Default value Description
page HTMLPage Html page.
property String Property selector.
value Any Property value.

Returns HTMLDocument[] Returns an array of found html frames.


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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String 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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.

Returns String Inner html string if a matched element, otherwise empty string.


INNER_HTML_ALL

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.

Returns String[] An array of inner html strings if all matched elements, otherwise empty array.


INNER_HTML_SET

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
htmlOrSelector String Html or css selector.
html String String of inner html.

Returns None


INNER_TEXT

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.

Returns String Inner text if a matched element, otherwise empty string.


INNER_TEXT_ALL

Source

INNER_TEXT_ALL returns an array of inner text of matched elements.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.

Returns String[] An array of inner text if all matched elements, otherwise empty array.


INNER_TEXT_SET

Source

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

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
textOrCssSelector String String of css selector.
text String String of inner text.

Returns None


INPUT

Source

INPUT types a value to an underlying input element.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
valueOrSelector String Css selector or a value.
value String Target value.
delay Int Target value.

Returns Boolean Returns true if an element was found.


INPUT_CLEAR

Source

INPUT_CLEAR clears a value from an underlying input element.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector.

Returns None


MOUSE

Source

MOUSE moves mouse by given coordinates.

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

Returns None


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 Default value Description
page HTMLPage Target page.
url String Target url to navigate.
timeout Int 5000 Navigation timeout.

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 Default value Description
page HTMLPage Target page.
entry Int 1 An integer value indicating how many pages to skip.
timeout Int 5000 Navigation timeout.

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


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 Default value Description
page HTMLPage Target page.
entry Int 1 An integer value indicating how many pages to skip.
timeout Int 5000 Navigation timeout.

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


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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Css selector for a pagination on the page.

Returns None


PARSE

Source

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

Argument Type Default value Description
html String Html string to parse.
params Object An object containing the following properties:
params.driver String Name of a driver to parse with.
params.keepCookies Boolean False Boolean value indicating whether to use cookies from previous sessions i.e. not to open a page in the incognito mode.
params.cookies HTTPCookies Set of http cookies to use during page loading.
params.headers HTTPHeaders Set of http headers to use during page loading.
params.viewport Object Viewport params.
params.viewport.height Int Viewport height.
params.viewport.width Int Viewport width.
params.viewport.scaleFactor Float Viewport scale factor.
params.viewport.mobile Boolean Value that indicates whether to emulate mobile device.
params.viewport.landscape Boolean Value that indicates whether to render a page in landscape position.

Returns HTMLPage Returns parsed and loaded html page.


PDF

Source

PDF prints a PDF of the current page.

Argument Type Default value Description
target HTMLPage String Target page or url.
params Object An object containing the following properties:
params.landscape Bool False Paper orientation.
params.displayHeaderFooter Bool False Display header and footer.
params.printBackground Bool False Print background graphics.
params.scale Float 1 Scale of the webpage rendering.
params.paperWidth Float 22 Paper width in inches.
params.paperHeight Float 28 Paper height in inches.
params.marginTo Float 1 Top margin in inches.
params.marginBottom Float 1 Bottom margin in inches.
params.marginLeft Float 1 Left margin in inches.
params.marginRight Float 1 Right margin in inches.
params.pageRanges String 13'.
params.ignoreInvalidPageRanges Bool False 2'.
params.headerTemplate String totalpages: total pages in the document for example, <span class=title></span> would generate span containing the title.
params.footerTemplate String Html template for the print footer. should use the same format as the headertemplate.
params.preferCSSPageSize Bool False 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 Pdf document in binary format.


SCREENSHOT

Source

SCREENSHOT takes a screenshot of a given page.

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

Returns Binary Screenshot in binary format.


SCROLL

Source

SCROLL scrolls by given coordinates.

Argument Type Default value Description
document HTMLDocument Html document.
x Int Float X coordinate.
true Int Float Y coordinate.
params Object Scroll params.
params.behavior String "instant" Scroll behavior
params.block String "center" Scroll vertical alignment.
params.inline String "center" Scroll horizontal alignment.

Returns None


SCROLL_BOTTOM

Source

SCROLL_BOTTOM scrolls the document’s window to its bottom.

Argument Type Default value Description
document HTMLDocument Html document.
x Int Float X coordinate.
true Int Float Y coordinate.
params Object Scroll params.
params.behavior String "instant" Scroll behavior
params.block String "center" Scroll vertical alignment.
params.inline String "center" Scroll horizontal alignment.

Returns None


SCROLL_ELEMENT

Source

SCROLL_ELEMENT scrolls an element on.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String If document is passed, this param must represent an element selector.
params Object Scroll params.
params.behavior String "instant" Scroll behavior
params.block String "center" Scroll vertical alignment.
params.inline String "center" Scroll horizontal alignment.

Returns None


SCROLL_TOP

Source

SCROLL_TOP scrolls the document’s window to its top.

Argument Type Default value Description
document HTMLDocument Html document.
x Int Float X coordinate.
true Int Float Y coordinate.
params Object Scroll params.
params.behavior String "instant" Scroll behavior
params.block String "center" Scroll vertical alignment.
params.inline String "center" Scroll horizontal alignment.

Returns None


SELECT

Source

SELECT selects a value from an underlying select element.

Argument Type Default value Description
element HTMLElement Target html element.
valueOrSelector String String[] Selector or a an array of strings as a value.
value String[] Target value. optional.

Returns String[] Array of selected values.


STYLE_GET

Source

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

Argument Type Default value Description
element HTMLElement Target html element.
names String, repeated Style name(s).

Returns Object Collection of key-value pairs of style values.


STYLE_REMOVE

Source

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

Argument Type Default value Description
element HTMLElement Target html element.
names String, repeated Style name(s).

Returns None


STYLE_SET

Source

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

Argument Type Default value Description
element HTMLElement Target html element.
nameOrObj - Style name or an object representing a key String Object 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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
attrNameOrSelector String String of an attr name or css selector.
attrValueOrAttrName String Any Attr value or name.
attrValueOrTimeout Any Int Attr value or a timeout.
timeout Int 5000 Wait timeout.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.
class String String of target css class.
timeout Int 5000 Wait timeout.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selectorOrClass String If document is passed, this param must represent an element selector. otherwise target class.
classOrTimeout String Int If document is passed, this param must represent target class name. otherwise timeout.
timeout Int If document is passed, this param must represent timeout. otherwise not passed.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.
class String String of target css class.
timeout Int 5000 Wait timeout.

Returns None


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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Target element’s selector.
timeout Int 5000 Wait timeout.

Returns None


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 Default value Description
page HTMLPage Target page.
timeout Int 5000 Navigation timeout.
params Object None Navigation parameters.
params.timeout Int 5000 Navigation timeout.
params.target Int Navigation target url.
params.frame HTMLDocument Navigation frame.

Returns None


WAIT_NO_ATTR

Source

WAIT_NO_ATTR waits until a target attribute’s value disappears

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
attrNameOrSelector String String of an attr name or css selector.
attrValueOrAttrName String Any Attr value or name.
attrValueOrTimeout Any Int Attr value or wait timeout.
timeout Int 5000 Wait 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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.
class String String of target css class.
timeout Int 5000 Wait timeout.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selectorOrClass String If document is passed, this param must represent an element selector. otherwise target class.
classOrTimeout String Int If document is passed, this param must represent target class name. otherwise timeout.
timeout Int If document is passed, this param must represent timeout. otherwise not passed.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String String of css selector.
class String String of target css class.
timeout Int 5000 Wait timeout.

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 Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
selector String Target element’s selector.
timeout Int 5000 Wait timeout.

Returns None


WAIT_NO_STYLE

Source

WAIT_NO_STYLE waits until a target style value disappears

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
styleNameOrSelector String Style name or css selector.
valueOrStyleName String Any Style value or name.
valueOrTimeout Any Int Style value or wait timeout.
timeout Int 5000 Wait timeout.

Returns None


WAIT_NO_STYLE_ALL

Source

WAIT_NO_STYLE_ALL waits until a target style value disappears on all matched elements with a given value.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
styleNameOrSelector String Style name or css selector.
valueOrStyleName String Any Style value or name.
valueOrTimeout Any Int Style value or wait timeout.
timeout Int 5000 Timeout.

Returns None


WAIT_STYLE

Source

WAIT_STYLE waits until a target style value appears

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
styleNameOrSelector String Style name or css selector.
valueOrStyleName String Any Style value or name.
valueOrTimeout Any Int Style value or wait timeout.
timeout Int 5000 Wait timeout.

Returns None


WAIT_STYLE_ALL

Source

WAIT_STYLE_ALL waits until a target style value appears on all matched elements with a given value.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
styleNameOrSelector String Style name or css selector.
valueOrStyleName String Any Style value or name.
valueOrTimeout Any Int Style value or wait timeout.
timeout Int 5000 Timeout.

Returns None


XPATH

Source

XPATH evaluates the XPath expression.

Argument Type Default value Description
node HTMLPage HTMLDocument HTMLElement Target html node.
expression String Xpath expression.

Returns Any Returns result of a given xpath expression.