Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Save as via code

Posted on 2013-12-17
8
Medium Priority
?
278 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:fpoyavo
ID: 39727089
Lets just stick to windows app reading html file. That's easier I think.
0
 
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 2000 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

972 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