LightNovelPub: Fix search

This commit is contained in:
Rajarshee Chatterjee
2021-05-20 08:52:20 +05:30
parent e770f1d620
commit 724d13173e
+6 -5
View File
@@ -165,15 +165,16 @@ const searchScraper = async (req, res) => {
const url = `${baseUrl}lnwsearchlive?inputContent=${searchTerm}`;
const result = await fetch(url);
const body = await result.json();
const result = await scraper(url);
const data = body.resultview;
$ = cheerio.load(data);
$ = cheerio.load(result);
let novels = [];
let results = JSON.parse($("body").text());
$ = cheerio.load(results.resultview);
$(".novel-item").each(function (result) {
const novelName = $(this).find("h4.novel-title").text();
const novelCover = $(this).find("img").attr("src");