Notifications
Clear all

[Closed] Get current url from dotnet webbrowser

Hello!

I’m currently experimenting with the dotnet webbrowser and I was wondering how I can print the current url.

I was using “wb.StatusText” until now, but it’s not exactly what I’m looking for. I have tried using .Url, but it I’m having some trouble getting the value, probably because it’s a property I can get or set (It’s not as straightforward as “print wb.StatusText”). I’m obviously missing a very basic step here
Is it possible that I have to convert the .url (which is a dotnetobject:system.uri) to text before I can print it? And if so, how do I do that exactly?

Thanks!

2 Replies

Hi,

system.uri is a dotNet object that represents things like webaddresses. It is not a text object. To convert it to text you can use either wb.toString() or the wb.AbsoluteUri property:


print wb.toString()
print wb.AbsoluteUri

hOpe this helps,
o

Yes! Thank you very much!