title: Trying to access a password protected url using python
body: <p>I've had problems accessing www.bizi.si or more specifically 
  <a href="http://www.bizi.si/BALMAR-D-O-O/" rel="nofollow">http://www.bizi.si/BALMAR-D-O-O/</a> for instance. If you look at it without registering you won't see any financial data. But if you use the free registration, I used username: Lukec, password: lukec12345, you can see some of the financial data. I've used this next code:</p>
  
  <pre><code>import urllib.parse
  import urllib.request
  import re
  import csv
  
  username = 'Lukec'
  password = 'lukec12345'
  url = 'http://www.bizi.si/BALMAR-D-O-O/'
  values = {'username':username, 'password':password}
  data = urllib.parse.urlencode(values)
  data = data.encode('utf-8')
  req = urllib.request.Request(url,data,values)
  resp = urllib.request.urlopen(req,data)
  respData = resp.read()
  
  paragraphs = re.findall('&lt;tbody&gt;(.*?)&lt;/tbody&gt;',str(respData))
  </code></pre>
  
  <p>And my len(paragraphs) is zero. I would really be grateful if anyone of you would be able to tell me how to access the page correctly. I know that the length being zero isnt the best indicator, but also the len(respData) if I use values as stated in my code or if I take it out of my code is the same, so I know I have not accessed the page through username, password.
  Thank you for you're help in advance and have a nice day.</p>