1

For webscraping purpose, I want to find all URLs present on the website which I can access using the tag 'a'. Refer to the below script

   // Get all urls in the page
        let urls = await page.evaluate(() => {
            let results = [];
            let items = document.querySelectorAll('a');
            items.forEach((item) => {
                results.push({
                    url: item.href,
                });

            });

Now there are some URLs hidden, and which can be accessed using clicking on the elements on the page. How can get the list of all clickable elements on a page using puppeteer or nodejs?

Chintamani Manjare
  • 1,543
  • 1
  • 13
  • 28

0 Answers0