Stateful programmatic web browser class based upon QtWebKit.
|
__init__(self,
qappargs=None,
debug_level=None)
Init a Browser instance. |
|
|
|
load(self,
url)
Load a web page and return status (a boolean). |
|
|
|
click(self,
selector,
wait_load=False,
wait_requests=None,
timeout=None)
Click any clickable element in page. |
|
|
|
click_link(self,
selector,
timeout=None)
Click a link and wait for the page to load. |
|
|
|
click_ajax(self,
selector,
wait_requests=1,
timeout=None)
Click a AJAX link and wait for the request to finish. |
|
|
|
wait_load(self,
timeout=None)
Wait until the page is loaded. |
|
|
|
wait(self,
waittime)
Wait some time. |
|
|
|
close(self)
Close Browser instance and release resources. |
|
|
|
create_webview(self,
show=False)
Create a QWebView object and insert current QWebPage. |
|
|
|
destroy_webview(self)
Destroy current QWebView. |
|
|
|
show(self)
Show webview browser. |
|
|
|
hide(self)
Hide webview browser. |
|
|
|
browse(self)
Let the user browse the current page (infinite loop). |
|
|
|
fill(self,
selector,
value)
Fill an input text with a string value using a jQuery selector. |
|
|
|
check(self,
selector)
Check an input checkbox using a jQuery selector. |
|
|
|
uncheck(self,
selector)
Uncheck input checkbox using a jQuery selector |
|
|
|
choose(self,
selector)
Choose a radio input using a jQuery selector. |
|
|
|
select(self,
selector)
Choose a option in a select using a jQuery selector. |
|
|
|
submit(self,
selector,
timeout=None)
Click a link and wait for the page to load. |
|
|
|
runjs(self,
jscode,
debug=True)
Inject Javascript code into the current context of page. |
|
|
|
|
|
|
|
get_cookies(self)
Return string containing the current cookies in Mozilla format. |
|
|
|
set_cookies(self,
string_cookies)
Set cookies from a string with Mozilla-format cookies. |
|
|
|
download(self,
url,
outfd=None)
Download a given URL using current cookies. |
|
|
|
|
|
html_contains(self,
regexp)
Return True if current HTML contains a given regular expression. |
|
|
|
|
|
snapshot(self,
box=None,
format=5)
Take an image snapshot of the current frame. |
|
|
|
get_url_from_path(self,
path)
Return the URL for a given path using the current URL as base. |
|
|
|
|
|
ignore_ssl_errors = True
If True, ignore SSL certificate errors.
|
|
user_agent = None
User agent for requests (see QWebPage::userAgentForUrl for details)
|
|
jslib = ' _jQuery '
Library name for jQuery library injected by default to pages.
|
|
download_directory = ' . '
Directory where downloaded files will be stored.
|
|
debug_stream = sys.stderr
File-like stream where debug output will be written.
|
|
debug_level = 0
Debug verbose level (ERROR, WARNING, INFO or DEBUG).
|
|
event_looptime = 0.01
Event loop dispatcher loop delay (seconds).
|
|
application
PyQt4.QtGui.Qapplication object.
|
|
webpage
PyQt4.QtWebKit.QWebPage object.
|
|
webframe
PyQt4.QtWebKit.QWebFrame main webframe object.
|
|
webview
PyQt4.QtWebKit.QWebView object.
|
|
manager
PyQt4.QtNetwork.QTNetworkAccessManager object.
|
|
cookiesjar
PyQt4.QtNetwork.QNetworkCookieJar object.
|