You can clone with
When setting jsdom: true, if the response to getHtml is not a full html page (no html tag), you get the following error:
ERROR: TypeError: Cannot read property 'compareDocumentPosition' of null
Seems like a jsdom issue, but is there any workaround?
JSDOM has some issues parsing certain documents - you'll have to open a ticket in that repo with a minimal test case. In the mean time you can try using the default parser and selector engine documented here