473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Webbrowser

Hello,

I want to create a webbrowser object programmatically, navigate to a URL,
and then analyze the document.

I create the following code (simplified):

Dim ie as new webbrowser
ie.navigate "http://www.google.com"
do while isnothing(ie.document)
threading.thread.sleep 1000
loop

This does not work; there's no error, but browser object does not navigate
anywhere. Same as if I declare the ebject with withevents, navigate, and
then expect callback - it never comes.

Navigation works if I create a separate form and put webbrowser control on
it.

Why it does not work as an object?

thanks,
Vadim Rapp
Dec 24 '06 #1
2 1908
"Vadim Rapp" <vr***@nospam.polyscience.comschrieb:
I want to create a webbrowser object programmatically, navigate to a URL,
and then analyze the document.

I create the following code (simplified):

Dim ie as new webbrowser
ie.navigate "http://www.google.com"
do while isnothing(ie.document)
threading.thread.sleep 1000
loop

This does not work; there's no error, but browser object does not navigate
anywhere. Same as if I declare the ebject with withevents, navigate, and
then expect callback - it never comes.
Use the code listed at
<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFileto download a
file.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 24 '06 #2
Hello, Herfried!
You wrote on Sun, 24 Dec 2006 18:58:52 +0100:

HKW"Vadim Rapp" <vr***@nospam.polyscience.comschrieb:
??>I want to create a webbrowser object programmatically, navigate to a
??>URL, and then analyze the document.
??>>
??>I create the following code (simplified):
??>>
??>Dim ie as new webbrowser
??>ie.navigate "http://www.google.com"
??>do while isnothing(ie.document)
??> threading.thread.sleep 1000
??>loop
??>>
??>This does not work; there's no error, but browser object does not
??>navigate anywhere. Same as if I declare the ebject with withevents,
??>navigate, and then expect callback - it never comes.

HKWUse the code listed at
HKW<URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFileto
HKWdownload a file.

Thanks, but the problem is, I need to analyze the retrieved document. With
webrequest, I get a text stream, and I don't see how I can easily convert it
into htmldocument. If I save the stream to file and then navigate to it, the
relative links in the document will not resolve correctly.

I was just curious why webbrowser so much insists on being in a container.

thanks,

Vadim Rapp
Dec 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jim Hubbard | last post by:
How would I implement the IDispatch interface to handle the following in VB.Net <BEGIN> Controlling Download and Execution The WebBrowser Control gives you control over what it downloads,...
5
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>>...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
8
by: Prosperz | last post by:
Hi, I would like to make thumbnails of web page by capture content of a WebBrowser. By example, capture http://www.google.com. I used WebBrowser control with Framework 2.0. I try this : ...
8
by: Dustan | last post by:
At http://docs.python.org/whatsnew/modules.html on the webbrowser module, it says "A number of additional browsers were added to the supported list such as Firefox, Opera, Konqueror, and elinks." ...
11
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
18
by: Zytan | last post by:
I have multiple threads writing to WebBrowser (using a function that checks InvokedRequired, and if so, invokes itself on the WebBrowser thread) and they are getting deadlocked. They only...
4
by: Gregory Bloom | last post by:
I'm running Python 2.5 under Windows. If I fire up IDLE and enter: it works like a champ, opening the page in Firefox. Same thing goes from a Windows cmd shell: it works as advertised. But...
11
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: ...
3
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.