Advertisement
metalx1000

Webkit with no GUI - Get Page Source HTML

Jun 22nd, 2015
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import webkit, gtk, sys
  4.  
  5. def get_source(webobj, frame):
  6.   x = web.get_main_frame().get_data_source().get_data()
  7.   print x
  8.   sys.exit()
  9.  
  10. print "loading..."
  11. win = gtk.Window()
  12.  
  13. web = webkit.WebView()
  14. web.open("http://filmsbykris.com/scripts")
  15. web.connect("load-finished", get_source)
  16.  
  17. win.add(web)
  18.  
  19. #win.show_all()
  20.  
  21. gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement