1

Inside a Google Apps script I would like to get a http-page via UrlFetchApp yielding a HTTPResonse. That Response gives me a string, but not a DOM. So I'm looking for some library which can parse a string and translate it into a DOM. This library should not be assuming to live in a browser, so many tricks described in

Parse and handle DOM that came as a string input

or

Best way to parse HTML in Javascript

won't work because they all (seem to) rely on living inside a browser. So I am looking for a javascript-library which does that parsing somehow self-contained.

Something like that exists?

Community
  • 1
  • 1
pbhd
  • 4,384
  • 1
  • 20
  • 26
  • Well, meanwhile found smething called rhp at http://code.google.com/p/s26blog/wiki/rhp, works, although needs in google-apps-script environment own implementation of document and element, first tests look good... – pbhd Nov 14 '12 at 19:30
  • 1
    Does it have to at "HTML" DOM or just a easily navigable XML like DOM. If XML like DOM is sufficient, you can use the parse the lenient option to parse the doc (https://developers.google.com/apps-script/class_xml#parse). This will work well with UrlFetchApp nicely on the server side. – Arun Nagarajan Nov 14 '12 at 22:01
  • What i want to do is to navigate and control some web-pages, e.g. get the page, fill out some fields, submit it, work on the reply, and so on. This can be done easily (Ok, not really) with the QtWebKit when using Qt. Was just looking for something in google-apps-script. The package I mentioned before (rhp), ok, it works for simple pages, but still needs a lot of work to suit my needs. So I'm close to give up on this and thing about implementing a Qt-Application able to do what I want make it offer some interface callable by google-apps-script, adding much more complexity as I desire... – pbhd Nov 14 '12 at 22:12

0 Answers0