Dear Person who may it concern,
I am struggling with access Confluence page from node.js.
error bad request returns when I run below node.js from terminal.
So, I think it is issue from Authentication.
Below is code that try to access confluence.
===========================================================
const PORT = 8000;
const express = require("express");
const axios = require("axios");
const cheerio = require("cheerio");
const app = express();
//Web scraping
const URL =
"https://confluence.xxxxxx.com/confluence/display/xxxxx/confluce page name here/";
const data = [];
axios(URL)
.then((response) => {
const htmlParser = response.data;
// console.log(htmlParser);
const $ = cheerio.load(htmlParser);
$(".table-wrap", htmlParser).each(function () {
const title = $(this)
.find(
'.teamcdummyprojectSchedule(Schedule)'
)
.text();
data.push({ title });
console.log(data);
});
})
.catch((error) => console.log(error));
===========================================================