Here is the code, its for a SEO project I am working on: import urllib, urllib2, re
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
def check_account(email, password, cookie): header = {'Cookie': 't=%s;js_csrf=%s;' % (cookie,cookie), 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'} data = {'t': cookie, 'login_email': email, 'login_password': password, 'lhs_type': 'default', 'display': 'desktop'}
try:
req = urllib2.Request('http://ift.tt/1gEYksL', urllib.urlencode(data), header)
resp = urllib2.urlopen(req)
except:
return False
read = resp.read()
return read
resp = urllib2.urlopen(urllib2.Request('http://ift.tt/OaJeKF', None)) cookie = re.findall(r't=(.*?);', str(resp.info()))[0]
resp_data = check_account('random@email.com','random', cookie)
print resp_data
Here is the reponse: err:{"login_email": {"message_html": "We didn\u0026rsquo;t allow this login because it appeared to be automated. Please contact \u003ca href='/support'\u003eDropbox support\u003c/a\u003e if you believe this was a mistake."}}
First time using stackoverflow for assistance, sorry if I made any mistakes
Aucun commentaire:
Enregistrer un commentaire