LightNovelPub: Fix search
This commit is contained in:
@@ -165,15 +165,16 @@ const searchScraper = async (req, res) => {
|
|||||||
|
|
||||||
const url = `${baseUrl}lnwsearchlive?inputContent=${searchTerm}`;
|
const url = `${baseUrl}lnwsearchlive?inputContent=${searchTerm}`;
|
||||||
|
|
||||||
const result = await fetch(url);
|
const result = await scraper(url);
|
||||||
const body = await result.json();
|
|
||||||
|
|
||||||
const data = body.resultview;
|
$ = cheerio.load(result);
|
||||||
|
|
||||||
$ = cheerio.load(data);
|
|
||||||
|
|
||||||
let novels = [];
|
let novels = [];
|
||||||
|
|
||||||
|
let results = JSON.parse($("body").text());
|
||||||
|
|
||||||
|
$ = cheerio.load(results.resultview);
|
||||||
|
|
||||||
$(".novel-item").each(function (result) {
|
$(".novel-item").each(function (result) {
|
||||||
const novelName = $(this).find("h4.novel-title").text();
|
const novelName = $(this).find("h4.novel-title").text();
|
||||||
const novelCover = $(this).find("img").attr("src");
|
const novelCover = $(this).find("img").attr("src");
|
||||||
|
|||||||
Reference in New Issue
Block a user