|
@@ -136,7 +136,7 @@ class Webshot extends CallableInstance<[Tweets, (...args) => void, number], Prom
|
|
|
.then(() => handle)
|
|
|
)
|
|
|
// throw early if tweet is unavailable
|
|
|
- .then(handle => handle.$('xpath=.//a[contains(@href,"notices-on-twitter")]').then(placeholder => placeholder ? null : handle))
|
|
|
+ .then(handle => handle.$('[data-testid="tweet"]').then(owner => owner ? handle : null))
|
|
|
.catch((err: Error): Promise<puppeteer.ElementHandle<HTMLDivElement> | null> => {
|
|
|
if (err.name !== 'TimeoutError') throw err;
|
|
|
logger.warn(`navigation timed out at ${getTimerTime()} seconds`);
|