浏览代码

fix bug with tweets with a blockquote

Mike L 3 年之前
父节点
当前提交
760a089462
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      dist/webshot.js
  2. 1 1
      src/webshot.ts

+ 1 - 1
dist/webshot.js

@@ -96,7 +96,7 @@ class Webshot extends CallableInstance {
                             });
                             });
                         }, 250);
                         }, 250);
                     }))
                     }))
-                        .then(() => page.waitForSelector('xpath=//section/*/*/div[.//article[not(.//time)]]', { timeout: getTimeout() }))
+                        .then(() => page.waitForSelector('xpath=//section/*/*/div[.//article[not(.//*[@data-testid]//time)]]', { timeout: getTimeout() }))
                         .then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
                         .then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
                         .then(sensitiveToggles => {
                         .then(sensitiveToggles => {
                         const count = sensitiveToggles.length;
                         const count = sensitiveToggles.length;

+ 1 - 1
src/webshot.ts

@@ -124,7 +124,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
               }, 250);
               }, 250);
             }))
             }))
             // find main tweet
             // find main tweet
-            .then(() => page.waitForSelector('xpath=//section/*/*/div[.//article[not(.//time)]]', {timeout: getTimeout()}))
+            .then(() => page.waitForSelector('xpath=//section/*/*/div[.//article[not(.//*[@data-testid]//time)]]', {timeout: getTimeout()}))
             // toggle visibility of sensitive tweets
             // toggle visibility of sensitive tweets
             .then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
             .then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
               .then(sensitiveToggles => {
               .then(sensitiveToggles => {