How can I get a Hyperlink url ?

9 ビュー (過去 30 日間)
Didier
Didier 2015 年 9 月 23 日
移動済み: Dyuman Joshi 2023 年 11 月 21 日
when I get an html page as a string with urlread (e.g. 'http://www.mathworks.com/index.html?s_tid=gn_loc_drop'), I can see the line '<li class="topnav_products ">Products</li>' and >Products< is a hyperlink to 'http://www.mathworks.com/products/'. Is it possible to get the hyperlink adress, here 'http://www.mathworks.com/products/' ?
Many thanks for your help
Didier

採用された回答

Dasharath Gulvady
Dasharath Gulvady 2015 年 9 月 28 日
Didier,
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:
  1 件のコメント
Didier
Didier 2015 年 9 月 28 日
移動済み: Dyuman Joshi 2023 年 11 月 21 日
Hi Dasharath, Many thanks !!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by