diff --git a/src/en/boxnovel/BoxNovelScraper.js b/src/en/boxnovel/BoxNovelScraper.js index e866e05..d8773bb 100644 --- a/src/en/boxnovel/BoxNovelScraper.js +++ b/src/en/boxnovel/BoxNovelScraper.js @@ -1,5 +1,6 @@ const cheerio = require("cheerio"); const fetch = require("node-fetch"); +const { htmlToText } = require("html-to-text"); const baseUrl = "https://boxnovel.com/novel"; const searchUrl = "https://boxnovel.com/"; @@ -125,7 +126,8 @@ const chapterScraper = async (req, res) => { $ = cheerio.load(body); const chapterName = $("div.text-left > h3").text(); - const chapterText = $(".reading-content").text(); + let chapterText = $(".reading-content").html(); + chapterText = htmlToText(chapterText); let nextChapter = null; diff --git a/src/en/novelfull/NovelFullScraper.js b/src/en/novelfull/NovelFullScraper.js index 3178fcc..6bde106 100644 --- a/src/en/novelfull/NovelFullScraper.js +++ b/src/en/novelfull/NovelFullScraper.js @@ -1,5 +1,6 @@ const cheerio = require("cheerio"); const fetch = require("node-fetch"); +const { htmlToText } = require("html-to-text"); const baseUrl = "https://novelfull.com"; @@ -132,7 +133,8 @@ const chapterScraper = async (req, res) => { $ = cheerio.load(body); const chapterName = $(".chapter-title").attr("title"); - const chapterText = $("#chapter-content").text(); + let chapterText = $("#chapter-content").html(); + chapterText = htmlToText(chapterText); let nextChapter = null; if ($("a#next_chap").attr("href")) { diff --git a/src/en/novelhall/NovelhallScraper.js b/src/en/novelhall/NovelhallScraper.js index 072caf8..3f3e37e 100644 --- a/src/en/novelhall/NovelhallScraper.js +++ b/src/en/novelhall/NovelhallScraper.js @@ -1,5 +1,6 @@ const cheerio = require("cheerio"); const fetch = require("node-fetch"); +const { htmlToText } = require("html-to-text"); const baseUrl = "https://www.novelhall.com/"; @@ -107,7 +108,8 @@ const chapterScraper = async (req, res) => { $ = cheerio.load(body); const chapterName = $("h1").text(); - const chapterText = $("div.entry-content").text(); + let chapterText = $("div.entry-content").html(); + chapterText = htmlToText(chapterText); let nextChapter = null; nextChapter = $('a[rel="next"]').attr("href"); diff --git a/src/en/readnovelfull/ReadNovelFullScraper.js b/src/en/readnovelfull/ReadNovelFullScraper.js index c715410..634246c 100644 --- a/src/en/readnovelfull/ReadNovelFullScraper.js +++ b/src/en/readnovelfull/ReadNovelFullScraper.js @@ -1,5 +1,6 @@ const cheerio = require("cheerio"); const fetch = require("node-fetch"); +const { htmlToText } = require("html-to-text"); const baseUrl = "https://readnovelfull.com"; @@ -132,7 +133,8 @@ const chapterScraper = async (req, res) => { $ = cheerio.load(body); const chapterName = $(".chr-title").attr("title"); - const chapterText = $("#chr-content").text(); + let chapterText = $("#chr-content").html(); + chapterText = htmlToText(chapterText); let nextChapter = null; if ($("a#next_chap").attr("href")) {