python - Evaluate javascript on a local html file (without browser) -


this part of project working on work.

i want automate sharepoint site, pull data out of database , coworkers have front-end access to.

i managed mechanize (in python) accomplish using python-ntlm, , patching part of it's source code fix reoccurring error.

now, @ hope final roadblock: part of form need submit seems output of javascript function :| , lo , behold... mechanize not support javascript. don't want emulate javascript functionality myself in python because ideally reusable solution...

so, anyone know how evaluate javascript on local html download sharepoint? want run javascript somehow (to complete loading of page), without browser.

i have looked selenium, it's pretty slow amount of work need done... looking pyv8 try , evaluate javascript myself... surely there must app or library (or anything) can this??

well, in end came down following possible solutions:

  • run chrome headless , collect html output (thanks koenp link!)
  • run phantomjs, headless browser javascript api
  • run htmlunit; same thing java
  • use ghost.py, python-based headless browser (that haven't seen suggested anyyyywhere reason!)
  • write dom-based javascript interpreter based on pyv8 (google v8 javascript engine) , add current "half-solution" mechanize.

for now, have decided use either use ghost.py or own modification of pyside/pyqt webkit (how ghost works) evaluate javascript, apparently can run quite fast if optimize them not download images , disable gui.

hopefully others find list useful!


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -