title: Cheerio not parsing through html a tags
body: <p>I followed a tutorial online to try my hand at building an API as a personal project. I'm new to this so I have no idea why the code in the tutorial works but mine doesn't even though I've only changed the website urls and the search keyword.</p>
  <pre><code>const PORT = 8000
  const express = require('express')
  const axios = require('axios')
  const cheerio = require('cheerio')
  const app = express()
  
  
  
  const newspapers = [
      {
          name: 'guardian',
          address: 'https://www.theguardian.com/international' 
      },
      {
          name: 'thetimes',
          address: 'https://www.thetimes.co.uk/russia-ukraine-war' 
      },
      {
          name: 'telegraph',
          address: 'https://www.telegraph.co.uk/russia-ukraine-war/' 
      },
      {
          name: 'cityam',
          address: 'https://www.cityam.com/?s=ukraine' 
      },
      {
          name: 'newyorktimes',
          address: 'https://www.nytimes.com/international/section/world/europe' 
      },
      {
          name: 'latimes',
          address: 'https://www.latimes.com/world-nation/story/2022-02-22/full-coverage-russia-ukraine' 
      },
      {
          name: 'thesydneymorningherald',
          address: 'https://www.smh.com.au/world/europe' 
      },
      {
          name: 'un',
          address: 'https://news.un.org/en/focus/ukraine' 
      },
      {
          name: 'bbc',
          address: 'https://www.bbc.com/news/world-60525350' 
      },
      {
          name: 'es',
          address: 'https://www.standard.co.uk/topic/ukraine' 
      },
      {
          name: 'sun',
          address: 'https://www.thesun.co.uk/topic/ukraine-war/' 
      },
      {
          name: 'dailymail',
          address: 'https://www.dailymail.co.uk/news/russia-ukraine-conflict/index.html' 
      },
      {
          name: 'nyp',
          address: 'https://nypost.com/search/ukraine/' 
      }
  ]
  
  const articles = []
  
  newspapers.forEach(newspaper =&gt; {
      axios.get(newspaper.address)
          .then(response =&gt; {
              const html = response.data
              const $ = cheerio.load(html)
  
              $('a:contains(&quot;ukraine&quot;)', html).each(function () {
                  const title = $(this).text()
                  const url = $(this).attr('href')
  
                  articles.push({
                      title,
                      url,
                      source: newspaper.name
                  })
              })
  
          })
  })
  
  app.get('/', (req, res) =&gt; {
      res.json('Welcome to my API')
  })
  
  app.get('/news', (req, res) =&gt; {
      res.json(articles)
  })
  
  app.listen(PORT, () =&gt; console.log(`server running on PORT ${PORT}`))
  </code></pre>
  <p>It sometimes returns a list if I only have the first 'The Guardian' url. Otherwise the articles list always returns empty. The tutorial code runs every time, so I don't think I'm being blocked from scrapping the websites.</p>
  <p>The tutorial: <a href="https://youtu.be/GK4Pl-GmPHk" rel="nofollow noreferrer">https://youtu.be/GK4Pl-GmPHk</a></p>