Solved

Save as via code

Posted on 2013-12-17
8
269 Views
Last Modified: 2014-01-30
Hi Experts,

I have page with a 10 hyperlinks. I would need to process this page and click via code each link as right click and do Save As html page.

Thanks.
0
Comment
Question by:fpoyavo
  • 4
  • 4
8 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39726867
What type of application are you working with?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39726990
C# windows form which reads html file or if you can give jquery one to do right on the web form would be great.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 39727019
Are you using the WebBrowser control with your Windows Forms application?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39727089
Lets just stick to windows app reading html file. That's easier I think.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 96

Expert Comment

by:Bob Learned
ID: 39727094
That last statement is confusing.  What would you like to do after reading the HTML file?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39727235
Nothing is confusing :))) Just get links from HTML by reading it and do saveas ...can you show how it looks in code ?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39727256
Nothing is confusing for you, because you understand your environment ;)

You can use the HTML Agility Pack to parse HTML.  It is available as a Nuget package.

Here is an example of parsing for anchors:

public void ParseHtml(string url)
{
    var document = new HtmlDocument();
    document.LoadHtml(url);

    var node = document.DocumentNode;    

    var anchorList = node.SelectNodes("//b/a[@href]"); 

    foreach (var anchor in anchorList)
    {
        var href = anchor.Href;
    }
}

Open in new window

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 39727340
hi,

Looks good. Let me try.

Thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now