pygmi.rsense.render_html#

Render html, by bmika1.

Exceptions#

BrowserNotFoundException

Browser not found Exception.

UnknownBrowserException

Unknown browser exception.

Functions#

render_in_browser(html_string[, save_path, browser])

Render the HTML content in a web browser.

Module Contents#

exception pygmi.rsense.render_html.BrowserNotFoundException(browser)#

Bases: Exception

Browser not found Exception.

Parameters:

browser (str)

exception pygmi.rsense.render_html.UnknownBrowserException(e)#

Bases: Exception

Unknown browser exception.

Parameters:

e (Exception)

pygmi.rsense.render_html.render_in_browser(html_string, save_path=None, browser=None)#

Render the HTML content in a web browser.

Parameters:
  • html_string (str) – The HTML content as a string.

  • save_path (str | None) – The path to save the HTML content as a file., by default None. If provided, the HTML content will be saved to the specified file and opened from it. If not provided or set to None, a temporary file will be created in the operating system’s default temporary directory. The temporary file will be removed once the rendering is complete. IMPORTANT: Please provide an absolute path to your file.

  • browser (str | None) – The web browser to use (i.e. “chrome”, “safari”), by default None. If provided, the HTML content will be opened using the specified browser. If not provided or set to None, the default browser will be used.

Return type:

None