Is there some module for Python that tells me when some page finish the loading, or something else on Firefox?
+4
A:
There's selenium
Code example test_google.py:
from selenium import selenium
sel = selenium("localhost", 4444, "*firefox", "http://www.google.com/webhp")
sel.start()
sel.open("http://www.google.com/webhp")
sel.type("q", "hello world")
sel.click("btnG")
sel.wait_for_page_to_load(5000)
assert "hello world - Google Search" == sel.get_title()
sel.stop()
nosklo
2010-05-07 16:13:59
but how do I use it with python ?
Shady
2010-05-07 16:20:21
Is there a way to only open the google.com (at your example), without the other window, the log/test one, Remote control window ?
Shady
2010-05-07 17:03:35
or maximize the google window and bring it to the front, letting the remote control window minimized or behind
Shady
2010-05-07 17:15:00
+1
A:
You can use the moz-repl plugin. It will instantiate a command prompt on a local port and you can then script it using the cmd module. This will allow you to peek at the browser internals and get back the information you need.
Noufal Ibrahim
2010-05-07 17:17:20
A:
you can alternatively try the gtkmozembed module. lets you run a firefox instance and load pages in there.
selenium might be best if you are just after load times, but if you want to do more interactions with the page, like execute javascript, or take screenshots even, gtkmozembed might be your man.
JiminyCricket
2010-05-07 17:29:08