title: "HTTP Error 500: Internal Server Error" -Web scraping
body: <p>Solved using the answer from QHarr!</p>
  
  <p>Trying to extract some information (starting with the title) from a website. 
  The code below works fine with <code>http://google.com</code>, but not with the link i need  (<code>url</code>).</p>
  
  <p>Error code: <code>"HTTP Error 500: Internal Server Error"</code></p>
  
  <p>Am I doing something wrong? Is it possible to do this another way?</p>
  
  <pre><code>from urllib.request import urlopen
  import urllib.error
  import bs4
  import time
  
  url = "http://st.atb.no/New/minskjerm/FST.aspx?visMode=1&amp;cTit=&amp;c1=1&amp;s1=16011301&amp;sv1=&amp;cn1=&amp;template=2&amp;cmhb=FF6600&amp;cmhc=00FF00&amp;cshb=3366FF&amp;cshc=FFFFFF&amp;arb=000000&amp;rows=1&amp;period=&amp;" 
  
  
  for i in range(5): #Try 5 times to reach page
      try: 
       html = urlopen(url)
      except urllib.error.HTTPError as exc:
          print('Error code: ', exc)
          time.sleep(1) # wait 10 seconds and then make http request again
          continue
      else:
          print('Success')
          break
  
  
  soup = bs4.BeautifulSoup(html, 'lxml')
  title = soup.find('title')
  print(title.getText()) 
  
  
  </code></pre>