rchipka / node-osmosis

Web scraper for NodeJS
4.12k stars 246 forks source link

Get HTML code of element #255

Closed dkochetkov closed 4 years ago

dkochetkov commented 4 years ago

Hello.

Is there any way to get the HTML code of the selected element for further saving in JSON?

dkochetkov commented 4 years ago

Found a solution:

...
.set('html', (context, data) => {
  return context.innerHTML;
})
...