how can I get the displayed text of a hyperlink converted to a string?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
JAY CAMERON
am 17 Mär. 2016
Bearbeitet: Stephen23
am 19 Sep. 2016
I use webread to get a string containing text and hyperlinks.
PageStr=webread('http://finance.yahoo.com/q/op?s=IBM&m=2015-001','ContentType','text');
The PageStr contains hyperlinks displayed as underlined blue characters. When I attempt get a portion of PageStr containing text and a hyperlink
StrikeTmpStr=PageStr(StrikeIndex(I):StrikeIndex(I)+29)
The resulting StrikeTmpStr is missing the hyperlink.
0 Kommentare
Akzeptierte Antwort
Brendan Hamm
am 19 Sep. 2016
A hyperlink which is displayed is only part of a html command. For instance the following makes a link to the MathWorks website which reads MathWorks:
link = '<a href="http://mathworks.com">MathWorks</a>. More Text here.'
Notice I placed some more text after the link as well, just to show you. Now if I index where the text being shown is I extract only that portion, but lose the important information about where that points:
link(32:40)
but if I index to the entire link statement: '<a href ...>...</a>', I will get the link:
link(1:44)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!