0

I use parse.com for a small and simple backend and I try to scrape a webpage for some image urls.

I was able to load the html from the site into a string with parse.com Cloud Code.

But now I need to convert the html into a document or another searchable structure. Is there a way to create a document from the html that I can use to search for specific tags?

Janusz
  • 187,060
  • 113
  • 301
  • 369
  • I am not sure what you mean by document. But if you want to write the html into a file, you can do something like `var buf = new Buffer(htmlString, 'utf8'); var base64String = buf.toString('base64') var file = new Parse.File('index.html', {base64: base64String});` – knshn Aug 11 '14 at 01:43
  • I want to generate a DOM Object or some tree structure that allows me to get specific tags by classes or ids. – Janusz Aug 11 '14 at 08:28
  • Oh, then you need a package like https://github.com/cheeriojs/cheerio but since parse is not a node.js environment, you can't have packages using node's internal apis. https://www.parse.com/questions/using-npm-modules-in-cloud-code – knshn Aug 11 '14 at 08:40

0 Answers0