Searching a webpage for 'href="'

4 views (last 30 days)
Janis Uhrig
Janis Uhrig on 19 Apr 2016
Edited: Jan on 21 Apr 2016
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?
Janis Uhrig
Janis Uhrig on 21 Apr 2016 // 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.

Sign in to comment.

Answers (2)

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

Jan on 21 Apr 2016
Edited: Jan on 21 Apr 2016
index = strfind(Str, 'href=')

Community Treasure Hunt

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

Start Hunting!

Translated by