'How to using querySelector under querySelectorAll in Puppeteer?

I want scrape data from one website from listing. My code:

    const listing = await page.evaluate(() => {
       Array.from(
        document.querySelectorAll(
          "#__next > div> main > div> div > div > div > div > ul > li "
        ),
        (element) => {
          const url = element; // > a
          const title = element; // > a > article > div > h3
          const address = element; // > a > article > p
          const price = element; // > a > article > div > span:nth-child(1)
          const priceForMeter = element; // > a > article > div > span:nth-child(2)
          const area = element; // > a > article > div > span:nth-child(3)
          const userProfile = element; // > a > article > div > div
        }
      );
    });

I want when I scraping each position on listing by this code:

"#__next > div> main > div> div > div > div > div > ul > li "

Scraping from each position additionaly bellow element:

        (element) => {
          const url = element; // > a
          const title = element; // > a > article > div > h3
          const address = element; // > a > article > p
          const price = element; // > a > article > div > span:nth-child(1)
          const priceForMeter = element; // > a > article > div > span:nth-child(2)
          const area = element; // > a > article > div > span:nth-child(3)
          const userProfile = element; // > a > article > div > div
        }
      );

How I can add to each position scraping nasted element (please look in comments by each variable). Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source