Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Save as via code

Posted on 2013-12-17
8
272 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
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MailAddress in vb 4 29
Sending an input value from a view to a controller in MVC 3 22
Where is this file? 3 25
C# Formatting DateTime String Value 5 26
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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