title: Issues Scraping the Web with Python
body: <p>I want to scrape the web with Python and I am running into some problems.
  Here is my code:</p>
  <pre><code>from urllib import request
  from bs4 import BeautifulSoup
  
  pageURL=&quot;https://gamesnacks.com/embed/games/omnomrun&quot;
  rawPage=request.urlopen(pageURL)
  
  soup=BeautifulSoup(rawPage, &quot;html5lib&quot;)
  
  content=soup.article
  
  linksList=[]
  
  
  for link in content.find_all('a'):
      url=link.get(&quot;href&quot;)
      img=link.get(&quot;src&quot;)
      text=link.span.text
  
  linksList.append({&quot;url&quot;:&quot;url&quot;,&quot;img&quot;:&quot;img&quot;,&quot;text&quot;:&quot;text&quot;})
  
  try:
      url=link.get(&quot;href&quot;)
      img=link.get(&quot;src&quot;)
      text=link.span.text
      linksList.append({&quot;url&quot;:&quot;url&quot;,&quot;img&quot;:&quot;img&quot;,&quot;text&quot;:&quot;text&quot;})
  except AttributeError:
      pass
  
  import json
  
  with open(&quot;links.json&quot;,&quot;w&quot;,encoding=&quot;utf-8&quot;) as links_file:
      json.dump(linksList,links_file,ensure_ascii=False)
  
  print(&quot;the work is done&quot;)
  
  </code></pre>
  <p>It gives an error in
  <code>for link in content.find_all('a'):</code></p>
  <p>I have already tried some online help but it didn't work out.</p>