|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WebbrowserI 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
Show quote
Hide quote
"Vadim Rapp" <vrapp@nospam.polyscience.com> schrieb: Use the code listed at > 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. <URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile> to download a file. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hello, Herfried!
You wrote on Sun, 24 Dec 2006 18:58:52 +0100: HKW> "Vadim Rapp" <vrapp@nospam.polyscience.com> schrieb: ??>> 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. HKW> Use the code listed at HKW> <URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFile> to HKW> download 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
Goodbye microsoft.public.dotnet.languages.vb
overriding array size How to determine if e-mail was sent OK Add Active Directory Users to a Group on a Workstation Rename registry Key [folder/ branch] MySQL and MyOleDB regex expressions How to get the checked columns in DataGridView Deleting controls Autorun on USB Flash Drive |
|||||||||||||||||||||||