No results for

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

Response.html()

suggest edits

Parses response as HTML and populate a Selection object.

Returns

TypeDescription
SelectionA Selection object

Example

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