|
@@ -129,7 +129,10 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
}, 250);
|
|
|
}))
|
|
|
// find main tweet
|
|
|
- .then(() => page.waitForSelector('xpath=//section/*/*/div[.//article[not(.//*[@data-testid]//time)]]', {timeout: getTimeout()}))
|
|
|
+ .then(() => page.waitForSelector(
|
|
|
+ 'xpath=//section/*/*/div[.//article[not(.//time[not(ancestor::div[@aria-labelledby])])]]',
|
|
|
+ {timeout: getTimeout()}
|
|
|
+ ))
|
|
|
// toggle visibility of sensitive tweets
|
|
|
.then(handle => handle.$$('xpath=..//a[contains(@href,"content_you_see")]/../../..//*[@role="button"]')
|
|
|
.then(sensitiveToggles => {
|
|
@@ -146,7 +149,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
logger.warn(`navigation timed out at ${getTimerTime()} seconds`);
|
|
|
return null;
|
|
|
})
|
|
|
- // scroll to last tweet by owner in thread, if any, or top of thread
|
|
|
+ // scroll to 2nd last tweet by owner in thread, if any, or top of thread
|
|
|
.then((handle: puppeteer.ElementHandle<HTMLDivElement>) => {
|
|
|
if (handle === null) throw new puppeteer.errors.TimeoutError();
|
|
|
return handle.evaluate(div => {
|