如何将一个 html 网页读入 MATLAB?同时,希望丢弃所有的 HTML 标签

如何将一个 html 网页读入 MATLAB?同时,希望丢弃所有的 HTML 标签。

 採用された回答

MathWorks Support Team
MathWorks Support Team 2019 年 11 月 1 日

0 投票

读取网页可以采用 webread 函数。对于去除标签,暂时没有直接实现的函数,但这个功能可以通过正则表达式实现,例如:
str = '<HTML>My flowers <b>may</b> <A HREF=''<http://www.a.com'' http://www.a.com''>bloom in</A> May</HTML>';
pat = '<[^>]*>';
regexprep(str, pat, '')

その他の回答 (0 件)

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!