I need to login to malwr site through python script I tried with various modules like machanize module,request module, however no success to login to site using scrpt.
I want to create automation script to download files from malware analysis site by parsing html page, but due to login issue I am not able to parse href attribute of html page to get links to download file.
Below is my code:
import urllib, urllib2, cookielib
username = 'myuser'
password = 'mypassword'
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
login_data = urllib.urlencode({'username' : username, 'password' : password})
opener.open('https://malwr.com/account/login/', login_data)
resp = opener.open('https://malwr.com/analysis/MDMxMmY0NjMzNjYyNDIyNDkzZTllOGVkOTc5ZTQ5NWU/')
print resp.read()
am I doing somthing wrong?