Why UrlFetchApp instead of ImportXML
IMPORTXML and IMPORTHTML are the obvious Sheets tools, but they fail silently on pages that require a cookie, set X-Frame-Options headers, or use JavaScript to render content after the initial HTML load. The first time I hit this, I wasted an hour wondering why my formula returned an empty cell with no error. UrlFetchApp.fetch runs server-side, bypasses all of that, and gives you the raw bytes Google's servers received — the same bytes you would see doing curl on the URL.
The tradeoff is that you get HTML as a plain string, not a parsed document tree. Apps Script has no built-in DOM parser (no querySelector, no getElementById). That sounds like a dealbreaker until you realize most scraping targets are a single number or a short text value sitting next to a predictable marker in the markup.