Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import gtk, webkit, urllib2, os, random
- def update_buttons(view, frame, resource, request, response):
- url=request.get_uri()
- print url
- u = urllib2.urlopen(url)
- file = open(str(random.randint(0, 1000000000)),'w')
- file.write(u.read())
- file.close()
- win = gtk.Window()
- win.connect('destroy', lambda w: gtk.main_quit())
- win.show()
- box1 = gtk.HBox()
- win.add(box1)
- web = webkit.WebView()
- web.connect("resource-request-starting", update_buttons)
- box1.pack_start(web)
- web.open("http://www.winknews.com/Sports/2014-11-05/Naples-16-year-old-is-best-Flowboarder-in-the-world")
- box1.show_all()
- gtk.main()
Add Comment
Please, Sign In to add comment