'how do i get the current url of qwebengineview in pyqt5 python?

So guys currently i'm working on a small web browser on python in PyQt5 but I want to get the current URL of the webpage on the QWebEngineView widget. I try:

webEngineView.url()

But no such luck. remember that I am using PyQt5, NOT PyQt4. Can somebody help me? What I mean is, I need the attribute of QWebEngineView, which is the URL of the widget.



Solution 1:[1]

.url() returns a QUrl object. Call toString() on the QUrl to get the raw Url.

webEngineView.url().toString()

Documentation

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex