WuxiaWorldSite: fix novelUrl
This commit is contained in:
@@ -14,10 +14,12 @@ const novelsScraper = async (req, res) => {
|
||||
|
||||
let novels = [];
|
||||
|
||||
$(".a_item").each( (i, el) => {
|
||||
$(".a_item").each((i, el) => {
|
||||
const novelName = $(el).find("a").attr("title");
|
||||
const novelCover = baseUrl + $(el).find("a > img").attr("src");
|
||||
const novelUrl = $(el).find(".name_views > a").attr("href");
|
||||
|
||||
let novelUrl = $(el).find(".name_views > a").attr("href").slice(1);
|
||||
novelUrl += "/";
|
||||
|
||||
const novel = {
|
||||
extensionId: 12,
|
||||
@@ -30,7 +32,7 @@ const novelsScraper = async (req, res) => {
|
||||
});
|
||||
|
||||
res.json(novels);
|
||||
}
|
||||
};
|
||||
|
||||
const novelScraper = async (req, res) => {
|
||||
const novelUrl = req.params.novelUrl;
|
||||
@@ -146,7 +148,6 @@ const chapterScraper = async (req, res) => {
|
||||
? $(".next_sesction > a").attr("href").split("/").pop()
|
||||
: null;
|
||||
|
||||
|
||||
novelUrl += "/";
|
||||
chapterUrl += "/";
|
||||
|
||||
@@ -175,10 +176,11 @@ const searchScraper = async (req, res) => {
|
||||
|
||||
let novels = [];
|
||||
|
||||
$(".a_item").each( (i, el) => {
|
||||
$(".a_item").each((i, el) => {
|
||||
const novelName = $(el).find(".name_views > a").attr("title");
|
||||
const novelCover = baseUrl + $(el).find("a > img").attr("src");
|
||||
const novelUrl = $(el).find(".name_views > a").attr("href");
|
||||
let novelUrl = $(el).find(".name_views > a").attr("href").slice(1);
|
||||
novelUrl += "/";
|
||||
|
||||
const novel = {
|
||||
extensionId: 12,
|
||||
@@ -190,10 +192,9 @@ const searchScraper = async (req, res) => {
|
||||
novels.push(novel);
|
||||
});
|
||||
|
||||
res.json(novels)
|
||||
res.json(novels);
|
||||
};
|
||||
|
||||
|
||||
module.exports = WuxiaWorldSiteScraper = {
|
||||
novelsScraper,
|
||||
novelScraper,
|
||||
|
||||
Reference in New Issue
Block a user