Pārlūkot izejas kodu

fix bug with tweets with a blockquote

Mike L 3 gadi atpakaļ
vecāks
revīzija
760a089462
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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);
                     }))
-                        .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(sensitiveToggles => {
                         const count = sensitiveToggles.length;

+ 1 - 1
src/webshot.ts

@@ -124,7 +124,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
               }, 250);
             }))
             // 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
             .then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
               .then(sensitiveToggles => {