0

hello i've been doing a project to analyse a chess tournament. Therefore i want to scrape the data from the website https://turniere.schachklub-kelheim.de/BAD-2022-U16/einzel. However it did't work as i planned.

I used this following code in Google apps script, but it doesn't give me the complete html.

function getLichessLink() {
  var url="https://turniere.schachklub-kelheim.de/BAD-2022-U16/einzel";
  var response=UrlFetchApp.fetch(url).getContentText();
  var pattern = new RegExp('<div id="root">(.*?)</div>', "g");
  var match = response.match(pattern)
}

my logger shows that the response is missing several tag and is empty, altough there should be content in there. Thanks for answers.

kevin
  • 1
  • 1
  • When your URL is retrieved using `UrlFetchApp.fetch`, it seems that `You need to enable JavaScript to run this app.` is included in the HTML. Unfortunately, in the current stage, `UrlFetchApp.fetch` cannot retrieve the HTML by executing Javascript. I thought that this might be an answer to `Why doesn't the UrlfetchApp.fetch command get the complete html?`. If this was not your expected answer, I apologize. – Tanaike May 30 '23 at 13:06
  • Does this answer your question? [Scraping data to Google Sheets from a website that uses JavaScript](https://stackoverflow.com/questions/74237688/scraping-data-to-google-sheets-from-a-website-that-uses-javascript) – Tedinoz May 31 '23 at 01:30

0 Answers0