1

many webpages use onload JavaScript to manipulate their DOM. Is there a way I can automate accessing the state of the HTML after these JavaScript operations?

A took like wget is not useful here because it just downloads the original source. Is there perhaps a way to use a web browser rendering engine?

Ideally I am after a solution that I can interface with from Python.

thanks!

hoju
  • 26,725
  • 37
  • 129
  • 173

2 Answers2

2

The only good way I know to do such things is to automate a browser, for example via Selenium RC. If you have no idea of how to deduce that the page has finished running the relevant javascript, then, just a real live user visiting that page, you'll just have to wait a while, grab a snapshot, wait some more, grab another, and check there was no change between them to convince yourself that it's really finished.

Alex Martelli
  • 811,175
  • 162
  • 1,198
  • 1,373
1

Please see related info at stackoverflow:

Community
  • 1
  • 1
mati
  • 5,058
  • 3
  • 30
  • 47