Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
50
rated 0 times [  57] [ 7]  / answers: 1 / hits: 117597  / 13 Years ago, sun, november 27, 2011, 12:00:00

I am working on a web-scraping project. One of the websites I am working with has the data coming from Javascript.



There was a suggestion on one of my earlier questions that I can directly call the Javascript from Python, but I'm not sure how to accomplish this.



For example: If a JavaScript function is defined as: add_2(var,var2)



How would I call that JavaScript function from Python?


More From » python

 Answers
79

Find a JavaScript interpreter that has Python bindings. (Try Rhino? V8? SeaMonkey?). When you have found one, it should come with examples of how to use it from python.



Python itself, however, does not include a JavaScript interpreter.


[#88886] Friday, November 25, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iliana

Total Points: 246
Total Questions: 109
Total Answers: 82

Location: Palestine
Member since Tue, Jul 20, 2021
3 Years ago
;