PyV8, can I manipulate DOM structure?
Question: Lets assume that we have PyV8:

    
    
    import PyV8
    ctxt = PyV8.JSContext()
    

and a python DOM structure, for example `xml.dom`

How can I feed a .js-file to PyV8 so that it could change DOM-structure that I
have.  
If I had it's content:

    
    
    $("#id").remove();
    

I want dom item to be removed.

[PyV8](http://code.google.com/p/pyv8/) has perfect hello-world example. But
I'd like to see something usefull.

To be clear, what I want to do is:  
`"Javascript file"` \-->-- **magic** \-->-- `DOM, (already built with html
file) and changed now with passed javascript file`


Answer: A good example for what you're trying to do can be found here:

<https://github.com/buffer/thug>

It's a python http client executing JS via PyV8 for security research
purposes, but can be strapped down easily for simpler needs.

