473,992 Members | 39,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

programmaticall y navigate websites

How can I programmaticall y 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 3263
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 programmaticall y 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**********@n ospamexcite.com wrote in message
news:ub******** ******@TK2MSFTN GP05.phx.gbl...
How can I programmaticall y 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
7075
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, "frmReportOptions" <== popup form This is the error I get when I try to move to the last page of the report *after* closing the popup: "This expression is typed incorectly, or is too complex to be evaluate...."
2
28417
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 call submitButton.click() Unfortunately it does not work while file_filed.vale = <path_to_file> has no effect, value <INPUT type=file...> cound not be set from script of that HTML page. Is there another way to set that value by means of ..NET ? Below...
2
6129
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 certificate programmatically through setup or in the program itself in windows (or ie) to get rid of the security-warnings? I wrote an own IServiceProvider but the IE.Navigate Calls always show the warnings to install the certificate.
3
2384
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 page not control
2
1734
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 then NavigateURL = "~/PatientEntry.aspx" End if 'something like this... but it doesn't work. Thank you, Mark
2
2402
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. **************************************** <Root_Element> <Topic index="1"> <Sub_Topic> <Notes></Notes>
3
5673
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 convert it to a windows service, and the application stopped working. I'm assuming because in my code I first Navigate to the document, and then print it --> since a service runs under a different context, the navigation/printing fails. I tried to...
1
2409
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 that the user can read from the pdf (the page number will be found in a database table). I have found code that will either 1) open the pdf in it's own application and 2) open the pdf in a VB Form. Either one of those is fine with me. However, I...
103
6973
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)? These are just a sample of nasty quicksand web pages I've run into which lock your browser into a loop and won't let you get out until you hit the "install" or "run" or "OK" button... (whatever it is they want you to do). http://www.spywareiso.com...
0
10228
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11925
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11495
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11729
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10998
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10160
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6506
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3842
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.