Visual C# Help!

Soldato
Joined
6 Jan 2005
Posts
3,633
Location
Cambridge
Hi, I'm trying to use Visual C# 2008 to make a program...

What I want to do is make a program that clicks a link in the webbrowser.

At the moment I can make the program fill in a form like this:

Code:
HtmlDocument htmldoc = null;
HtmlElement htmlelem = null;
htmldoc = webBrowser1.Document;
htmlelem = htmldoc.GetElementById("textbox"); 
htmlelem.SetAttribute("value","Test");
Also I have can make it click a submit button like this:

Code:
htmlelem = htmldoc.GetElementById("submit");
htmlelem.InvokeMember("Click");
Now what I want to do is click a link, but the website could be different each time so all I will know is the text which will be "Next".

Does anyone know how to make it follow a link with the text "Next"?

Thanks,
Paul
 
This may be way off track but you could screen scrape the HTML, use a regular expression to strip links and search the results for next links and use your invokemember.
 
Back
Top Bottom