我有一个 html 文件,我需要生成它使用的所有资源的列表:*.htm、*.html、*.css、*.js、*.jpg
我尝试了许多选项,例如 grep 和 sed,但没有太多成功。也不确定如何在 JAVA 中进行操作。
这是一个示例文件内容:
--------------------------------
> <link rel="StyleSheet" href="css/webworks.css" type="text/css"
> media="all" />
> <script type="text/javascript" language="JavaScript1.2" src="wwhdata/common /context.js">
> /script>
> <a class="WebWorks_Breadcrumb_Link" href="Page1.htm#1110364">Job Status</a> > Jobs tatus</div>
> <div class="Indented"><a name="1115395">The <img class="Default" src="images/Pic.2.jpg" width="26" height="29" style="display: inline;
> float: none; left: 0.0; top: 0.0;" alt="" /> icon indicates that the
> job is recurring. Hover the mouse over the icon to display the
> schedule.</a></div>
> <div class="Body_Help_only"><a href="javascript:WWHClickedPopup('HelpSR2', 'Page4.htm#1110375', '');"
> title="fsafsa" name="1118038">abcde</a></div>
> <div class="Body_Help_only"><a href="javascript:WWHClickedPopup('HelpSR2', 'Page2.htm#1110547', '');"
> title="fsafsa" name="1118063">fsafsa</a></div>
> <div class="Body_Help_only"><a href="javascript:WWHClickedPopup('HelpSR2', 'Page3.htm#1110472', '');"
> title="fsafasb" name="1118082">fsafsa</a></div>
输出应该是:
-----------------
css/webworks.css
wwhdata/common/context.js
Page1.htm
images/Pic.2.jpg
Page4.htm
Page2.htm
Page3.htm