Forum Archive

Manipulate Webview in .pyui file with the corresponding .py file

procryon

Hi all, I've started learning how to use the UI views and web views and such and have a simple question.

I made a new file with UI and added a webview in the UI designer. How would I got into the other file created alongside the UI file and load "www.google.com" in it?

Here's the code in the script:

import ui
import urllib

v = ui.load_view()
v.present('fullscreen')

And in the UI, there's just a webview half the size of the grid sheet. I want to load "www.google.com" onto that webview.

Thanks in advance!

JonB

try v['webview1'].load_url('https://google.com')

or replace webview1 with whatever you named your webview in the designer.