2021年3月10日星期三

Cannot get a page from Wikipedia API

What's wrong with my function ? I wanna get a wiki page using their api but something goes wrong every single time I try

const getPageByTitle = title => {    const url = `https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&title='${title}'&exintro=1`;      return fetch(url)      .then(response => response.json())      .then(data => data.query.pages);  };    getPageByTitle("Fraktur").then(console.log);
https://stackoverflow.com/questions/66575887/cannot-get-a-page-from-wikipedia-api March 11, 2021 at 11:06AM

没有评论:

发表评论