Michael Wu
Michael Wu

Reputation: 9

How should I get the above price on google flight with cheerio on GAS?

var URL = "<https://www.google.com/travel/flights/s/fhfbNzzwytaS3Xgs8>";

let response = UrlFetchApp.fetch(URL);

let $ = Cheerio.load(response.getContentText(),{decodeEntities:false})

let data = $('div,span').text();
Logger.log(data);

Hi. I try to get the above price on Google Flight

enter image description here

but the result are the other words, doesn't output any price at all.

enter image description here

So how should I get correct price result that I want?

Upvotes: 0

Views: 86

Answers (0)

Related Questions