I'm creating an app in Google Sheets using Google App Script. The app scrapes a web page and returns an HTML page to me as a string. I'm trying to insert it into a DOM so that I can use DOM queries to find the data I need within the page. Normally, you could do that by either creating a document fragment with document.createDocumentFragment()
, or creating a detached element with document.createElement()
, then setting the innerHTML with the HTML string. The problem is, GAS doesn't have a document
context.
Does anyone have ideas for a workaround, or maybe some other way to query a large text string?
p.s. My very first instinct was to find the data I need as an API but I can't find anything that meets my needs. Screen scraping is my last resort.
UPDATE: Thank you for whoever found and tagged the similar question. Cheerio library for GS is the correct solution. https://stackoverflow.com/a/61928025/735374