필터 지우기
필터 지우기

How can I get a Hyperlink url ?

조회 수: 3 (최근 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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by