473,386 Members | 1,598 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,386 software developers and data experts.

programmatically navigate websites

How can I programmatically navigate a website just as a user would? click
on buttons, hyperlinks, etc. I know how to read nodes using XPath but I
don't know what classes to use to navigate.

I have to write a program to automatically read mail from an html mail
system.
Thanks,
T

Oct 22 '08 #1
2 3233
it will depend on the website. you can use webclient to get the page.
fews sites render valid xml, so you will need an html parser to read the
page. some pages require javascript, or have javascript modifiy the dom.
this would be common with a mail system, but it may have a dumb mode
(maybe for mobile devices). for instance with aspx any thing but an
imagebutton or submit button require javascript to do postback. you will
need emulate this.

you should read the w3c http 1.1 protocol spec so you know how to get
and post data. some site (say an aspx site with viewstate), will require
you do a get and postback matching data.

you should get a tool like fiddler, so you can see the raw data passed
back and forth and what headers are required.

-- bruce (sqlwork.com)

Tina wrote:
How can I programmatically navigate a website just as a user would?
click on buttons, hyperlinks, etc. I know how to read nodes using XPath
but I don't know what classes to use to navigate.

I have to write a program to automatically read mail from an html mail
system.
Thanks,
T
Oct 22 '08 #2


"Tina" <Ti**********@nospamexcite.comwrote in message
news:ub**************@TK2MSFTNGP05.phx.gbl...
How can I programmatically navigate a website just as a user would? click
on buttons, hyperlinks, etc. I know how to read nodes using XPath but I
don't know what classes to use to navigate.

I have to write a program to automatically read mail from an html mail
system.
Thanks,
T
You have a few options:
* Automate IE - you can navigate to a page and use the DOM to fill out text
boxes, press buttons and read results
* Use MSXML2.XmlHttp.6.0 - you can make POST and GET calls and parse the
returned results using the 'HtmlFile' COM class to create an HTML document
* The same as above but using WebRequest and WebResponse from .NET
* Use a tool like Visual Studio - you can record macros that move you
through a site, then you refine them to use inputs from a database and make
decisions according to returned data
--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Oct 22 '08 #3

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

Similar topics

4
by: deko | last post by:
I can't move a multi-page report to the last record unless I keep the popup form (that defined it's subreports) open. DoCmd.OpenReport "rptStandard", acViewNormal DoCmd.Close acForm,...
2
by: Evgeny Zoldin | last post by:
Hi ALL. I need to simulate send POST data ( - file upload) as it was submitted in Browser. In C# I create instanse of IE, navigate to page with the form, fill in the fields and try to Submit by...
2
by: Matthias Leonhardt | last post by:
Hi, My c#-prog shall call some https URLs at our webserver. It has a self-signed certificate. I also use IE per COM-Control to call a website at our server (also https). How can I install the...
3
by: greg | last post by:
Hi I need to programmatically click imagebutton from javascript so I write in a link navigate url document.forms.nextBtn.fireEvent('onclick'); !!!!! it says nextBtn undefined it is a web...
2
by: Monty | last post by:
Hi, I need to open a page filtered to a certain employee. I plan to do this by programmatically opening the page. How do I do this? I tried the following... If GriEmployee.SelectedIndex = 1...
2
by: James Fifth | last post by:
Hello and God Bless, I am stumped trying to get a simple xml database replacing certain data with other data programmatically. This is what my xml looks like. ...
3
by: kmsultan1 | last post by:
Hello all, I have a windows application that programmatically sends an html document to the printer using the AxSHDocVw.AxWebBrowser object. The application works beautifully. I tried to...
1
by: aecorzine | last post by:
Hopefully someone can help... I am new to the programming environment. I am attempting to programmatically (through a click event) open a pdf file and go to a specific page within that file so...
103
by: Tom | last post by:
How do we get out of the browser infinite loop quicksand when we navigate to web pages designed to lock us in and force us to hit the "pay me" button (whatever they want to force you to do)? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.