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);
没有评论:
发表评论