I am using robobrowser to login in to a password protected website. I am able to download html code and edit it. However, when I use following method:
br = RoboBrowser(history=True)
url = 'https://dummywebsite.html/dummy.pdf'
br.open(url)
pdf_file = '/localdir/local.pdf'
with open(pdf_file, 'wb') as output:
output.write("%s" % (br.parsed))
However, the output is not valid pdf file. Same happens when I try to download images. I have gone through documentation but couldn't find anything yet. The alternative to this seems mechanize. However, there is no python 3 support for that.
I would be grateful with help or pointers to look forward. Also, any other alternative if robobrowser cannot handle this would be great help.