-
Notifications
You must be signed in to change notification settings - Fork 175
Description
This example program from the course, I have run with a number of URL. Some URL display space instead of the text.
Can someone tell me whats need to do, to get the text display instead of space? In that URL that not display text.
import * as cheerio from 'cheerio';
const url = "https://www.fandom.com/";
const response = await fetch(url);
if (response.ok) {
const html = await response.text();
const $ = cheerio.load(html);
console.log($("h1").text());
} else {
throw new Error(HTTP ${response.status});
}
This are exampel on URL that works
"https://warehouse-theme-metal.myshopify.com/collections/sales";
"https://flights.booking.com/flights/ARN-PMI/?type=ROUNDTRIP&adults=2&children=&cabinClass=ECONOMY&from=ARN&to=PMI&fromCountry=SE&toCountry=ES&depart=2026-05-31&return=2026-06-07&salesCountry=se¤cy=SEK&lang=sv&ext-tr=rJliJi861QX6nBM7BqOMDubeF%7ESV77bh-%7E_qZ0VwPzN66HZQIfWchFw%3D%3D&aid=2421158&label=part-kayak%3Atype-precheck%3Adev-web%3Aorair-ARN%3Adestair-PMI%3Aorco-SE%3Adestco-ES%3Aadpc-BDC--PRE_sv_SE_FFDCMP2%3Aloc-se";
"https://www.ikea.com/se/sv/cat/vaxter-pp003/?filters=f-subcategories%3A20492";
"https://en.wikipedia.org/wiki/Main_Page";
This are exampel on URL that display space insted of the text
"https://www.avanza.se/index/om-indexet.html/19002/omx-stockholm-30";
"https://www.sj.se/sok-resa/valj-resa/Stockholm%20Central/G%C3%A4vle%20Central/2026-02-13/2026-02-14";
Sven