3

I've searched on Google and StackOverflow but am having trouble finding the answer, even though it seems like it should be easy to do.

How can I use Python to load a URL into its own window, rather than in a browser? I imagine this should be trivial in Tkinter or some other GUI package.

Nathan Arthur
  • 8,287
  • 7
  • 55
  • 80
  • [This seems relevant.](http://stackoverflow.com/questions/126131/python-library-for-rendering-html-and-javascript#126250) – Nathan Arthur Jun 02 '16 at 00:30
  • 1
    Ive done this using the ie driver + wxHTMLWindow +wxPython ... but it only handles html4.0 (and im not sure about js) – Joran Beasley Jun 02 '16 at 00:31

2 Answers2

4

Yeah. that's very easy with QWebView in PyQt/PySide

You basically instantiate a new QWebView and pass the url to it

QWebView.load(QUrl('http://www.www.pythoncentral.io'))

you can read more here

http://pythoncentral.io/pyside-pyqt-tutorial-qwebview/

and also in the pyQt docs

http://pyqt.sourceforge.net/Docs/PyQt4/qwebview.html

danidee
  • 9,298
  • 2
  • 35
  • 55
  • I believe QWebView is quite expensive, as you need a special license to use their product with that module. They have free versions, but the one that includes QWebView is $500/month. It's insane. – NL23codes Jan 31 '20 at 21:51
4

A new option would be: pywebview

pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own native GUI window. It gives you power of web technologies in your desktop application, hiding the fact that GUI is browser based.

See here: https://github.com/r0x0r/pywebview

zvi
  • 3,677
  • 2
  • 30
  • 48
  • 1
    This should be the accepted answer - the only problem is not being able to embed a pywebview window, into a GUI, since it is its own window. – NL23codes Jan 31 '20 at 21:52