|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Read Javascript Messagebox content from webclientDoes anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web page I go to, read the message in it or content of it, then close it so I can continue on. I don't know how to reference the popup box or send a command to click the ok button to close it. Mike Duclon Michael Duclon wrote:
> Does anyone know how I might use the webclient class to navigate to a web WebClient does a HTTP request and fetches the HTTP response for you but > page in a vb.net app, and then if a JavaScript popup appears from the web > page I go to, read the message in it or content of it, then close it so I > can continue on. > I don't know how to reference the popup box or send a command to click the > ok button to close it. it does not know anything about HTML documents or HTML documents with JavaScript. If you want to render a HTML document like a browser does then in .NET 2.0 you have the WebBrowser control <http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx> I am not sure however there is a way then from .NET to close JavaScript alert dialogs. thanks Martin, I've decided to try and use the WebBrowser control.
I'm looking at it to see if I can figure out how to close the javascript window using that route. It seems like I should be able to access it from the document object. If anyone has any thoughts on that or has tried this please let me know, and if I find the answer I will post back. Michael Duclon Show quoteHide quote "Martin Honnen" <mahotr***@yahoo.de> wrote in message news:%23iMY3NrzGHA.4932@TK2MSFTNGP02.phx.gbl... > > > Michael Duclon wrote: > >> Does anyone know how I might use the webclient class to navigate to a web >> page in a vb.net app, and then if a JavaScript popup appears from the web >> page I go to, read the message in it or content of it, then close it so I >> can continue on. >> I don't know how to reference the popup box or send a command to click >> the ok button to close it. > > WebClient does a HTTP request and fetches the HTTP response for you but it > does not know anything about HTML documents or HTML documents with > JavaScript. > If you want to render a HTML document like a browser does then in .NET 2.0 > you have the WebBrowser control > <http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx> > I am not sure however there is a way then from .NET to close JavaScript > alert dialogs. > > > -- > > Martin Honnen --- MVP XML > http://JavaScript.FAQTs.com/ When you request the page using the webclient classes, the remote server
sends the page back as a response. It does not undertsand html or javascript and will not actually run the page for you as a browser would, in short you have the resulting HTML as if you did a view source from within a browser.. Regards John Timney (MVP) "Michael Duclon" <mduc***@verizon.net> wrote in message news:aqiKg.672$%75.192@trnddc05...Show quoteHide quote > Does anyone know how I might use the webclient class to navigate to a web > page in a vb.net app, and then if a JavaScript popup appears from the web > page I go to, read the message in it or content of it, then close it so I > can continue on. > I don't know how to reference the popup box or send a command to click the > ok button to close it. > Mike Duclon > Here is a link to an article that explain a bit about blocking popups by
extending the .NET 2.0 WebBrowser control: http://www.codeproject.com/csharp/ExtendedWebBrowser.asp "Michael Duclon" <mduc***@verizon.net> wrote in message news:aqiKg.672$%75.192@trnddc05...Show quoteHide quote > Does anyone know how I might use the webclient class to navigate to a web > page in a vb.net app, and then if a JavaScript popup appears from the web > page I go to, read the message in it or content of it, then close it so I > can continue on. > I don't know how to reference the popup box or send a command to click the > ok button to close it. > Mike Duclon >
Diff between 'n-tier' vs 'distributed architecture' vs. 'multi-layered programming'?
Structures, Classes for storing data Validating emails Please, can anyone convert the following dot net snippet to pascal VB .NET FTP Convert Access Table to Text File using VB get create table script for a SQL Server object what is wrong with this VB2005 EXPRESS Print contents of picturebox |
|||||||||||||||||||||||