473,396 Members | 1,726 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,396 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 1910
"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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.