title: Crawl urls from sitemap.xml using Apify Puppeteer and requestQueue
body: <p>Apify can crawl links from sitemap.xml</p>
  
  <pre><code>const Apify = require('apify');
  
  Apify.main(async () =&gt; {
      const requestList = new Apify.RequestList({
          sources: [{ requestsFromUrl: 'https://edition.cnn.com/sitemaps/cnn/news.xml' }],
      });
      await requestList.initialize();
  
      const crawler = new Apify.PuppeteerCrawler({
          requestList,
          handlePageFunction: async ({ page, request }) =&gt; {
              console.log(`Processing ${request.url}...`);
              await Apify.pushData({
                  url: request.url,
                  title: await page.title(),
                  html: await page.content(),
              });
          },
      });
  
      await crawler.run();
      console.log('Done.');
  });
  </code></pre>
  
  <p><a href="https://sdk.apify.com/docs/examples/puppeteersitemap#docsNav" rel="nofollow noreferrer">https://sdk.apify.com/docs/examples/puppeteersitemap#docsNav</a></p>
  
  <p>However, I am not sure how to crawl links from sitemap.xml if I am using requestQueue. For ex:</p>
  
  <pre><code>const requestQueue = await Apify.openRequestQueue();
  await requestQueue.addRequest({url: "https://google.com});
  
   //this is not working. Apify is simply crawling sitemap.xml 
   //and not adding urls from sitemap.xml to requestQueue
   await requestQueue.addRequest({url:`https://google.com/sitemap.xml`});
  
   const crawler = new Apify.PuppeteerCrawler({
      requestQueue,
  
      // This function is called for every page the crawler visits
      handlePageFunction: async (context) =&gt; {
  
  
          const {request, page} = context;
  
          const title = await page.title();
          let page_url = request.url;
          console.log(`Title of ${page_url}: ${title}`);
  
          await Apify.utils.enqueueLinks({
              page, selector: 'a', pseudoUrls, requestQueue});
      },
  
  
  });
  
  await crawler.run();
  </code></pre>