修改为前后端分离模式
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const puppeteer = require("puppeteer")
|
||||
const { seep } = require("../utils.js");
|
||||
|
||||
async function getListData(url) {
|
||||
async function getQqListData(url) {
|
||||
const browser = await puppeteer.launch({
|
||||
// 关闭无头模式,方便我们看到这个无头浏览器执行的过程
|
||||
headless: false,
|
||||
@@ -16,6 +16,17 @@ async function getListData(url) {
|
||||
let list = await page.evaluate(() => {
|
||||
return window.__PINIA__.episodeMain
|
||||
})
|
||||
// let qb = await page.$$(".b-btn--round")
|
||||
await page.$$eval(".b-btn--round", (list) => {
|
||||
console.log(list)
|
||||
for (let i of list) {
|
||||
if (i && i.innerText) {
|
||||
if ("全部" == i.innerText.trim()) {
|
||||
i.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
for (let i of list.listData[0].tabs) {
|
||||
let text = i.text
|
||||
let more = await page.$(".b-tab__more")
|
||||
@@ -30,6 +41,16 @@ async function getListData(url) {
|
||||
}
|
||||
}
|
||||
}, text)
|
||||
await page.$$eval(".b-tag-list__tag", (list, text) => {
|
||||
console.log(list)
|
||||
for (let i of list) {
|
||||
if (i && i.innerText) {
|
||||
if (text == i.innerText.trim()) {
|
||||
i.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
}, text)
|
||||
await seep(1000);
|
||||
}
|
||||
|
||||
@@ -59,5 +80,5 @@ async function getListData(url) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getListData
|
||||
getQqListData
|
||||
}
|
||||
Reference in New Issue
Block a user