Beary21 0 Newbie Poster

I'm trying to login to Valve's Steam website, but without any luck my 2 different scripts aren't working. Help please!?

Any script I find on the web appears to be outdated.

import urllib, urllib2, cookielib, webbrowser

data = urllib.urlencode({
 'action': 'doLogin',
 'goto': '',
 'steamAccountName': "****",
 'steamPassword': "****",

# Login to Steam
jar = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))"", data).close()

# Check if logged in'')
data =
print data


import mechanize, cookielib, webbrowser

jar = cookielib.CookieJar()

browser = mechanize.Browser()
cookies = mechanize.CookieJar()
browser.addheaders = [
  ('User-Agent', 'Opera/9.80 (Windows NT 6.1; U; IBM EVV/3.0/EAK01AG9/LE; en) Presto/2.9.168 Version/11.52'),
  ('Accept', 'application/xhtml+voice+xml;version=1.2, application/x-xhtml+voice+xml;version=1.2, text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1'),
  ('Accept-Language', 'nl-BE,nl;q=0.9,en;q=0.8'),
  ('Accept-Encoding', 'gzip, deflate'),
  ('Referer', ''),
  ('Connection', 'Keep-Alive'),

browser["username"] = "*****"
browser["password"] = "*****"

response = browser.submit()

result =

print result =
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.