Skip to main content

get()

Last updated 24/10/2023

The code is getting the raw data from a website and printing it to the Five Inspect.

Will get the raw data and print it to the Five Inspect
    const response = webClient.get(webClient.RAW, 'https://www.news.com.au');
five.log(response.raw);

The code is opening a headless web page browser for a website.

Open headless web page browser
    const page = webClient.get(webClient.BROWSER, 'https://www.news.com.au');
if (page.isOk() === false) {
return five.createError(page, 'Failed to open page');
}

//extract some elements using a class name as a selector
let stories = page.elements(".storyblock_title_link");