INNER CODE UNIT · TypeScript

getXpathElement

mifi/instauto · src/index.ts:416

  async function getXpathElement(xpath: string, opts?: WaitForSelectorOptions): Promise<ElementHandle | null> {
    try {
      return await page.waitForSelector(`::-p-xpath(${xpath})`, opts);
    } catch {
      logger.debug(`Element not found for xpath: ${xpath}`);
      return null;
    }
  }

  async function navigateToUser(username: string) {
    if (isAlreadyOnUserPage(username)) return true;

    // logger.log('navigating from', page.url(), 'to', url);
    logger.log(`Navigating to user ${username}`);

    const url = getUserPageUrl(username);
    const status = await gotoWithRetry(url);
    if (status === 404) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…