I'm trying to open url with mechanize but not just open it and close it right away I want it to open the url then wait 7 minute then close the url.
what I'm trying to do :
import mechanize
import cookielib
import time
url='http://google.com/'
op = mechanize.Browser()
cj = cookielib.LWPCookieJar()
op.set_handle_robots(False)
op.set_handle_equiv(True)
op.set_handle_referer(True)
op.set_handle_redirect(True)
op.set_cookiejar(cj)
op.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=7)
op.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
op.open(url)
time.sleep(7)
print op.geturl()
but didn't work. how can I do it?
thnx.