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.

2
  • This seems relevant. Commented Jun 2, 2016 at 0:30
  • 1
    Ive done this using the ie driver + wxHTMLWindow +wxPython ... but it only handles html4.0 (and im not sure about js) Commented Jun 2, 2016 at 0:31

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.
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

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.