I need to download a file, but in order to do so, I have to accept license agreement.
For example, from
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
,
I would like to download
Linux x86 146.84 MB jdk-8u40-linux-i586.rpm
I thought about something like:
browser = spynner.Browser()
url = "http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html"
browser.load(url)
browser.runjs("acceptAgreement(window.self, 'sjre-8u40-oth-JPR');")
file = browser.download("http://download.oracle.com/otn/java/jdk/8u40-b26/jdk-8u40-linux-i586.rpm")
if file == None or file == "":
print("Wrong")
else:
data = file.read()
with open("code3.rpm", "wb") as code:
code.write(data)
but it always says "Wrong" so there is probably nothing in the file
variable.
Can someone please give me a hint?