mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-16 07:30:43 +08:00
Update jd_task_newUnique.js
This commit is contained in:
parent
0b6a372c54
commit
422bb4138d
@ -1,5 +1,4 @@
|
|||||||
import {Template} from '../../template.js'
|
import {Template} from '../../template.js'
|
||||||
import * as cheerio from 'cheerio';
|
|
||||||
|
|
||||||
export class Main extends Template {
|
export class Main extends Template {
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -23,11 +22,8 @@ export class Main extends Template {
|
|||||||
user
|
user
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
let $ = cheerio.load(html);
|
|
||||||
let scriptTags = $('script').toArray();
|
|
||||||
let data = []
|
let data = []
|
||||||
for (let script of scriptTags) {
|
for (let content of this.matchAll(/<script>([^\<]+)<\/script>/g, html)) {
|
||||||
let content = $(script).html();
|
|
||||||
if (content && content.includes('__react_data__')) {
|
if (content && content.includes('__react_data__')) {
|
||||||
var window = {}
|
var window = {}
|
||||||
eval(content)
|
eval(content)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user