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일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

제품

태그

질문:

2015년 9월 23일

이동:

2023년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by