Browse Source

bot improve

master
filesite 7 months ago
parent
commit
ee66d03860
  1. 11
      bot/Bilibili.mjs
  2. 2
      bot/Kuaishou.mjs
  3. 2
      bot/Xigua.mjs

11
bot/Bilibili.mjs

@ -36,15 +36,8 @@ class Bilibili extends HeroBot { @@ -36,15 +36,8 @@ class Bilibili extends HeroBot {
//等待所有内容加载完成
const tab = await hero.activeTab;
await tab.waitForLoad('AllContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await hero.waitForState({
all(assert) {
assert(
hero.document.title,
text => text != '',
);
}
}, {timeoutMs: configs.heroTabOptions.timeoutMs});
await tab.waitForLoad('DomContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await hero.waitForPaintingStable({timeoutMs: configs.heroTabOptions.timeoutMs});
//解析网页HTML数据
data.title = await hero.document.title;

2
bot/Kuaishou.mjs

@ -36,7 +36,7 @@ class Kuaishou extends HeroBot { @@ -36,7 +36,7 @@ class Kuaishou extends HeroBot {
//等待所有内容加载完成
const tab = await hero.activeTab;
await tab.waitForLoad('AllContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await tab.waitForLoad('DomContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await hero.waitForPaintingStable({timeoutMs: configs.heroTabOptions.timeoutMs});
//解析网页HTML数据

2
bot/Xigua.mjs

@ -36,7 +36,7 @@ class Xigua extends HeroBot { @@ -36,7 +36,7 @@ class Xigua extends HeroBot {
//等待所有内容加载完成
const tab = await hero.activeTab;
await tab.waitForLoad('AllContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await tab.waitForLoad('DomContentLoaded', {timeoutMs: configs.heroTabOptions.timeoutMs});
await hero.waitForPaintingStable({timeoutMs: configs.heroTabOptions.timeoutMs});
//解析网页HTML数据

Loading…
Cancel
Save