
Automate Data Entry: From Web Pages to Spreadsheets (No-Code + Code)
Data entry from web pages to spreadsheets is tedious. Here is how to automate it. No-Code Option: Google Sheets IMPORTXML =IMPORTXML("https://example.com", "//h1") =IMPORTXML("https://example.com", "//table//tr//td") Works for simple pages. Breaks on JavaScript-heavy sites. Code Option: Scrape to Google Sheets const { google } = require ( " googleapis " ); const cheerio = require ( " cheerio " ); // 1. Scrape the data const res = await fetch ( url ); const $ = cheerio . load ( await res . text ()); const rows = $ ( " table tr " ). map (( i , row ) => $ ( row ). find ( " td " ). map (( j , cell ) => $ ( cell ). text (). trim ()). get () ). get (); // 2. Write to Google Sheets const sheets = google . sheets ({ version : " v4 " , auth }); await sheets . spreadsheets . values . append ({ spreadsheetId : " YOUR_SHEET_ID " , range : " Sheet1 " , valueInputOption : " RAW " , requestBody : { values : rows } }); Code Option: Scrape to Excel const XLSX = require ( " xlsx " ); const wb = XLSX . u
Continue reading on Dev.to Webdev
Opens in a new tab



