469,950 Members | 2,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

Programmatically navigating/"running" a webpage

Hi all,

I think this is a longshot, but is there a technique for programmatically
run a webpage?

Let's say one of our vendors has a page that we go to daily to pick up some
files. Each time, the user clicks a link, that brings up a file dialog
prompting for a local name to download to and OK's. This process is
repeated for a number of files.

I'm wondering if something like this is possible: You could have a form
hosting an MS WebControl, navigated to a page where you know the layout.
Then perhaps there might be a method exposed that would allow you to read
the text of the HTML programmatically. You could parse that to decipher
which href you need, then post the page as if that link had been clicked.

The whole idea feels very kludgy, even if it would work, but it would suit a
few purposes.

TIA,

John
Jul 21 '05 #1
3 3284
The typically way to do this is with regular expressions.
What you would do is the following:

'Create a connection to the web page
Dim wRequest As Net.HttpWebRequest =
Net.HttpWebRequest.Create("urlhere")

'Get a reference to the response object
Dim wResponse As System.Net.HttpWebResponse =
wRequest .GetResponse

'Get the web page
Dim sr As New IO.StreamReader(obj.GetResponseStream)
Dim strPage As String = sr.ReadToEnd

Then, parse the strPage variable using regular
expressions to find the correct a href tag.

Hope this helps.

Jeff Levinson

Author of "Building Client/Server Applications with
VB.NET: An Example Driven Approach"
-----Original Message-----
Hi all,

I think this is a longshot, but is there a technique for programmaticallyrun a webpage?

Let's say one of our vendors has a page that we go to daily to pick up somefiles. Each time, the user clicks a link, that brings up a file dialogprompting for a local name to download to and OK's. This process isrepeated for a number of files.

I'm wondering if something like this is possible: You could have a formhosting an MS WebControl, navigated to a page where you know the layout.Then perhaps there might be a method exposed that would allow you to readthe text of the HTML programmatically. You could parse that to decipherwhich href you need, then post the page as if that link had been clicked.
The whole idea feels very kludgy, even if it would work, but it would suit afew purposes.

TIA,

John
.

Jul 21 '05 #2
John.

Try Windows Scripting Host - I have seen complete web site test harnesses
built using this language

- peteZ

"John Spiegel" <js******@c-comld.com> wrote in message
news:uN**************@TK2MSFTNGP10.phx.gbl...
Hi all,

I think this is a longshot, but is there a technique for programmatically
run a webpage?

Let's say one of our vendors has a page that we go to daily to pick up some files. Each time, the user clicks a link, that brings up a file dialog
prompting for a local name to download to and OK's. This process is
repeated for a number of files.

I'm wondering if something like this is possible: You could have a form
hosting an MS WebControl, navigated to a page where you know the layout.
Then perhaps there might be a method exposed that would allow you to read
the text of the HTML programmatically. You could parse that to decipher
which href you need, then post the page as if that link had been clicked.

The whole idea feels very kludgy, even if it would work, but it would suit a few purposes.

TIA,

John

Jul 21 '05 #3
Thanks, guys. I'm looking into these!
"John Spiegel" <js******@c-comld.com> wrote in message
news:uN**************@TK2MSFTNGP10.phx.gbl...
Hi all,

I think this is a longshot, but is there a technique for programmatically
run a webpage?

Let's say one of our vendors has a page that we go to daily to pick up some files. Each time, the user clicks a link, that brings up a file dialog
prompting for a local name to download to and OK's. This process is
repeated for a number of files.

I'm wondering if something like this is possible: You could have a form
hosting an MS WebControl, navigated to a page where you know the layout.
Then perhaps there might be a method exposed that would allow you to read
the text of the HTML programmatically. You could parse that to decipher
which href you need, then post the page as if that link had been clicked.

The whole idea feels very kludgy, even if it would work, but it would suit a few purposes.

TIA,

John

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Claire | last post: by
3 posts views Thread by gregory_may | last post: by
3 posts views Thread by John Spiegel | last post: by
4 posts views Thread by Mr BigSmoke | last post: by
5 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.