Solved

Save as via code

Posted on 2013-12-17
8
271 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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