forked from DebaucheryLibrarian/traxxx
Added Little Caprice Dreams scraped (WIP).
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
const { JSDOM } = require('jsdom');
|
||||
const moment = require('moment');
|
||||
const http = require('./http');
|
||||
const virtualConsole = require('./virtual-console')(__filename);
|
||||
|
||||
const { window: globalWindow } = new JSDOM('');
|
||||
const { window: globalWindow } = new JSDOM('', { virtualConsole });
|
||||
|
||||
function trim(str) {
|
||||
if (typeof str !== 'string') {
|
||||
@@ -440,7 +441,7 @@ function initAll(context, selector, window) {
|
||||
}
|
||||
|
||||
function extract(htmlValue, selector) {
|
||||
const { window } = new JSDOM(htmlValue);
|
||||
const { window } = new JSDOM(htmlValue, { virtualConsole });
|
||||
|
||||
if (selector) {
|
||||
return init(window.document.querySelector(selector), window);
|
||||
@@ -450,7 +451,7 @@ function extract(htmlValue, selector) {
|
||||
}
|
||||
|
||||
function extractAll(htmlValue, selector) {
|
||||
const { window } = new JSDOM(htmlValue);
|
||||
const { window } = new JSDOM(htmlValue, { virtualConsole });
|
||||
|
||||
return initAll(window.document, selector, window);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user