Searching a webpage for 'href="'

1 次查看(过去 30 天)
Janis Uhrig
Janis Uhrig 2016-4-19
编辑: Jan 2016-4-21
Is there a way to search on a webpage for the string 'href="' like it is done with the string 'http:' in cleve molers surfer.m example?
  2 个评论
Guillaume
Guillaume 2016-4-19
Can you provide a link to that example?
Janis Uhrig
Janis Uhrig 2016-4-21
https://www.math.washington.edu/~greenbau/Math_498/surfer.m // Here they are looking for the string 'http:' ,but the website I want to crawl does have the links like this: href="studierende/bachelor-studiengaenge/betriebswirtschaft/aktuelles/terminplaene/terminplan-ss/" class="link">Terminplan</a. So the algorithm can't find the link.

请先登录,再进行评论。

回答(2 个)

Meade
Meade 2016-4-20
Try regexp . For example:
exp = '<href="\w+">'
matches = regexp(youStr,exp,'match')

Jan
Jan 2016-4-21
编辑:Jan 2016-4-21
index = strfind(Str, 'href=')

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by