From 2f5954eca385a5e5909ab90ad7cf5b935eec7f58 Mon Sep 17 00:00:00 2001 From: Tim Voronov Date: Sat, 6 Mar 2021 01:25:37 -0500 Subject: [PATCH] Added docs about statusCodes --- examples/history-api.fql | 16 ++++++++++++++++ pkg/stdlib/html/document.go | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 examples/history-api.fql diff --git a/examples/history-api.fql b/examples/history-api.fql new file mode 100644 index 00000000..57300481 --- /dev/null +++ b/examples/history-api.fql @@ -0,0 +1,16 @@ +LET page = DOCUMENT("https://soundcloud.com", { driver: "cdp"}) +LET doc = page.mainFrame + +WAIT_ELEMENT(doc, ".trendingTracks") +SCROLL_ELEMENT(doc, ".trendingTracks") +WAIT_ELEMENT(doc, ".trendingTracks .badgeList__item") + +LET song = ELEMENT(doc, ".trendingTracks .badgeList__item") +CLICK(song) + +WAIT_ELEMENT(doc, ".l-listen-hero") + +RETURN { + page: page.url, + first: doc.url +} diff --git a/pkg/stdlib/html/document.go b/pkg/stdlib/html/document.go index 25edcf9f..a19273d0 100644 --- a/pkg/stdlib/html/document.go +++ b/pkg/stdlib/html/document.go @@ -32,6 +32,9 @@ type PageLoadParams struct { // @param {Object[]} [params.ignore.resources] - Collection of rules to ignore resources during page load and navigation. // @param {String} [params.ignore.resources.*.url] - Resource url pattern. If set, requests for matching urls will be blocked. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*". // @param {String} [params.ignore.resources.*.type] - Resource type. If set, requests for matching resource types will be blocked. +// @param {Object[]} [params.ignore.statusCodes] - Collection of rules to ignore certain HTTP codes that can cause failures. +// @param {String} [params.ignore.statusCodes.*.url] - Url pattern. If set, codes for matching urls will be ignored. Wildcards ('*' -> zero or more, '?' -> exactly one) are allowed. Escape character is backslash. Omitting is equivalent to "*". +// @param {Int} [params.ignore.statusCodes.*.code] - HTTP code to ignore. // @param {Object} [params.viewport] - Viewport params. // @param {Int} [params.viewport.height] - Viewport height. // @param {Int} [params.viewport.width] - Viewport width.