gotquestions is a package designed to scrape the gotquestions.org api
const gq = require("/path/to/gotquestions/src/index.js");
(async () => {
await gq.fetchDataByQuery("Jesus");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
})();
All errors return the following object
{
error: true,
errorStack: "..."
}
await gq.fetchDataByUrl("https://www.gotquestions.org/prophecies-of-Jesus.html");
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "...",
url: "..."
}
*/
await gq.fetchDataByQuery("Jesus", 0);
/*
{
error: false,
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
articleBody: "..."
}
*/
await gq.search("Jesus")
/*
{
error: false,
queryResults: [
{
articleTitle: "How many prophecies did Jesus fulfill? | GotQuestions.org",
url: "https://www.gotquestions.org/prophecies-of-Jesus.html"
},
...
]
}
*/
gotquestions is licensed under the MIT License.