开发者

Python, Webkit: how to get the DOM after the page has loaded?

开发者 https://www.devze.com 2023-01-19 02:33 出处:网络
In my cod开发者_运维百科e I\'ve connected to the WebView\'s load-finished event. The particular callback function takes a webview object and frame object as arguments. Then I tried executing get_dom_d

In my cod开发者_运维百科e I've connected to the WebView's load-finished event. The particular callback function takes a webview object and frame object as arguments. Then I tried executing get_dom_document() on the frame & the webview objects respectively. It seems this method doesn't exist for those objects...

PS: i started with the tips i got here http://www.gnu.org/software/pythonwebkit/

UPDATE (11-Sep-2010): I think the link I shared relates to a new & different project. Its not a solution per se. My bad!


it's definitely there.

and you can't just "take the tips from http://www.gnu.org/software/pythonwebkit/" you actually have to COMPILE THE CODE (reason: standard pywebkitgtk DOES NOT have W3C DOM accessor functions).

then take a look in pythonwebkit/pywebkitgtk/examples and run browser.py and you'll see what to do.

l.


i forgot to mention (and it wasn't on the documentation, which i've now updated): you specifically need to check out the "python_codegen" branch, otherwise you just end up with plain vanilla webkit. which is of absolutely no use to you.

0

精彩评论

暂无评论...
验证码 换一张
取 消