Forum Archive

Get ui.webview() loaded url

donnieh

After I load a url, how do I retrieve it?

```

import ui
w, h = ui.get_screen_size()

v = ui.View()
wv = ui.WebView()
wv.width = w
wv.height = h
wv.load_url('https://www.google.com')
v.add_subview(wv)
v.present()

print current url???```

donnieh

This seemed to work but not sure if it is the best way...

print wv.evaluate_javascript('window.location.href')

cvp

Thanks, I didn't know!
I was still searching... and had found with dir(wv) that there was no attribute URL nor method geturl/get_url