How can I get a Hyperlink url ?

11 views (last 30 days)
Didier on 23 Sep 2015
Answered: Didier on 28 Sep 2015
when I get an html page as a string with urlread (e.g. ''), I can see the line '<li class="topnav_products ">Products</li>' and >Products< is a hyperlink to ''. Is it possible to get the hyperlink adress, here '' ?
Many thanks for your help

Accepted Answer

Dasharath Gulvady
Dasharath Gulvady on 28 Sep 2015
The function "urlread" returns a string containing the entire text of the webpage at the specified URL. You may then use regular expressions to extract hyperlinks from this text.
html = urlread(url);
hyperlinks = regexprep(html,'<a.*?/a>','');
The below MATLAB Answers post gives a sample example for the same:

More Answers (1)

Didier on 28 Sep 2015
Hi Dasharath, Many thanks !!


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!