使用 AppleScript 解析 HTML 源代码 [英] Parsing HTML source code using AppleScript
问题描述
我正在尝试解析已在 Automator 中转换为 TXT 文件的 HTML 文件.
我之前使用 Automator 从网站下载了 HTML 文件,现在我正在努力解析源代码.
最好,我只想获取表格的信息,我需要对 1800 个不同的 HTML 文件重复此操作.
以下是源代码示例:
<身体><div id="标题"><div class="wrapper"><span class="access"><div id="fb-root"></div><span class="access">黄金账户:<a class="upgrade" title="Account Details" href="http://www.hedge-professionals.com/account-details.html" >Active </a>以 Edward 的身份登录| <a href="javascript:void(0);"onclick='logout()' class="logout">Sign Out</span></span></div><!--/wrapper --></div><!--/header --><div id="刊头"><div class="wrapper"><a href="http://www.hedge-professionals.com" ><img src="http://www.hedge-professionals.com/images/hedgep_logo_white.png" alt="Hedge Professionals 数据库" width="333" height="46" class="logo" border="0"/></a><div id="导航"><ul><li ><a href='http://www.hedge-professionals.com/dashboard.html' >仪表板</a></li><li ><a href='http://www.hedge-professionals.com/people.html'class='current' >People</a></li><li ><;a href='http://www.hedge-professionals.com/watchlists.html' >我的关注列表</a></li><li ><a href='http://www.hedge-professionals.com/my-searches.html' >我的搜索</a></li><li ><a href='http://www.hedge-professionals.com/my-profile.html' >我的个人资料</a></li></ul></div><!--/navigation --></div><!--/wrapper --></div><!--/masthead--><div id="内容"><div class="wrapper"><div id="main-content"><!-- 每个项目的东西--><span class="section"><img src="http://www.hedge-professionals.com/images/people/noimage_53x53.jpg" alt="Christian Sieling" width="52" height="53" class="profile-pic" id="profile-pic-104947"/><h1><span id="profile-name-104947" >Christian Sieling</span></h1><ul class="gbutton-group right"><li><a class="gbutton bold pie" href="http://www.hedge-professionals.com/people.html">«返回 </a></li><li><a class="gbutton 粗体药丸盒式点击" href="http://www.hedge-professionals.com/addtoWatchlist.php?usr=114752" id="row-104947" title='添加到关注列表'>添加到关注列表</a></li><div style="float:right;padding:3px 3px;text-align:center;margin-top:5px;"><span id="profile-updated-date" >更新日期:2010 年 8 月 4 日</span><br/><a class="gbutton bold pie" href="http://www.hedge-professionals.com/profile/suggest/people/104947/Christian-Sieling" style="margin:5px;"title='报告不准确的数据'>报告不准确的数据</a>
<h2><span id="profile-details-104947" >在 <a href="http://www.hedge-professionals.com/quicksearch/search/Lumix+Capital+Management+Ltd."><span title='Lumix Capital Management Ltd.'>Lumix Capital Management Ltd.</span></a></span><input type="hidden" name="sub-id" id="sub-id" value="114752">;</h2></span><table width="100%" border="0" cellspacing="0" cellpadding="0" id="profile-table"><tr><th>角色</th><td><p>其他</p></td></tr><tr><th>组织类型</th><td><p>资产管理器</p></td></tr><tr><th>电子邮件</th><td><a href="mailto:cs@lumixcapital.com" title="cs@lumixcapital.com" >cs@lumixcapital.com</a></td></tr><tr><th>网站</th><td><a href="http://www.lumixcapital.com/" target="_new" title="http://www.lumixcapital.com/" >http://www.lumixcapital.com/</a></td></tr><tr><th>电话</th><td>41 78 616 7334</td></tr><tr><th>传真</th><td></td></tr><tr><th>邮寄地址</th><td>Birrenstrasse 30</td></tr><tr>第<第>个城市第>个<td>辛德勒吉</td></tr><tr><th>State</th><td>CH</td></tr><tr><th>国家</th><td>瑞士</td></tr><tr><th class="lastrow" >邮政编码</th><td class="lastrow" >8834</td></tr></div><!--/main-content --><div id="侧边栏" >
<div id="similar_sidebar" class="similar_refine" >
</div><!--/wrapper --></div><!--/content --><div id="页脚">