title: How to display a certain number of links along with information
body: <p>How to display a certain number of links along with information?
  First code asks me which page to open and how many items to display. But no matter what I do, my links are displayed correctly, but the text is not correct</p>
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  page = int(input(&quot;page: &quot;))
  results = int(input(&quot;results count: &quot;))
  
  URL = &quot;...&quot; + &quot;page&quot; + str(page)
  HEADERS = {
      &quot;User-Agent&quot;: &quot;...&quot;
  }
  
  r = requests.get(url=URL, headers=HEADERS)
  soup = BeautifulSoup(r.text, 'html.parser')
  
  
  imgs = soup.find_all(&quot;img&quot;, class_=&quot;attachment-game size-game wp-post-image&quot;)[0:results]
  data = soup.find_all(&quot;article&quot;, class_=&quot;game&quot;)[0:results]
  for x in imgs:
      x = x[&quot;src&quot;]
      for i in data:
          i = i.text
      print(x + i)
  </code></pre>