Is there anyway to run JavaScript in python?

Diez B. Roggisch deets at web.de
Mon Jan 3 11:46:31 EST 2011


crow <wentlv at gmail.com> writes:

> Hi, I'm writing a test tool to simulate Web browser. Is there anyway
> to run JavaScript in python? Thanks in advance.

Not really. Yes, you can invoke spidermonkey. But the crucial point
about running JS is not executing JS, it's about having the *DOM* of the
browser available. Which spidermonkey obviously hasn't.

So, I recommend using Selenium. 

Diez



More information about the Python-list mailing list