No results for

Powered byAlgolia
⚠️ This is the archived documentation for k6 v0.47. Go to the latest version.

Response.html()

Parses response as HTML and populate a Selection object.

Returns

TypeDescription
SelectionA Selection object

Example

import http from 'k6/http';
export default function () {
const res = http.get('https://stackoverflow.com');
const doc = res.html();
doc
.find('link')
.toArray()
.forEach(function (item) {
console.log(item.attr('href'));
});
}