login about faq

Do any of the controls have the ability to extract parameters from a certain HTML tags? Like if I wanted to extract all the href parameters in <a> tags for an HTML document, is there a way to do that with MHT, etc?

asked Apr 16 '13 at 08:59

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

edited Apr 16 '13 at 09:00


One possible solution is to convert the HTML to well-formed XML by using the Chilkat HTML-to-XML component/class, and then use an XML API (Chilkat XML if desired) to traverse the XML and get the href's.

If using the Chilkat .NET API, there is also an undocumented (freeware) class named Chilkat.HtmlUtil which provides the following method:

Chilkat.StringArray HtmlUtil.GetHyperlinkedUrls(String html);
You may pass in the HTML and it returns a Chilkat.StringArray object containing the collection of URL's found in the href attribute of the <a> tags.

link

answered Apr 16 '13 at 09:05

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20
×4
×1

Asked: Apr 16 '13 at 08:59

Seen: 1,108 times

Last updated: Apr 16 '13 at 09:05

powered by OSQA