how to use webkit code in scrapy/python
Question: In the question at [How to combine scrapy and htmlunit to crawl urls with
javascript](http://stackoverflow.com/questions/8047666/how-to-combine-scrapy-
and-htmlunit-to-crawl-urls-with-javascript), it is advised to use webkit with
scrapy to go through javascript. However, this [example Snipplr
snippet](http://snipplr.com/view/66996/renderedinteractive-javascript-with-
gtkwebkitjswebkit/) says:

    
    
    import gtk
    import webkit
    import jswebkit
    

I am new to Python. From whatever I understand, webkit (written in C/C++ )
needs to have Python wrappers. I looked around but could not find anything
like that. Any advise appreciated.


Answer: This is the simplest example you can start here

    
    
    import gtk 
    import webkit 
    
    view = webkit.WebView() 
    
    sw = gtk.ScrolledWindow() 
    sw.add(view) 
    
    win = gtk.Window(gtk.WINDOW_TOPLEVEL) 
    win.add(sw) 
    win.show_all() 
    
    view.open("http://w3.org/") 
    gtk.main()
    

You can learn more from here <http://code.google.com/p/pywebkitgtk/> Also have
a look here <http://dvlabs.tippingpoint.com/blog/2011/11/28/malicious-content-
harvesting>

