如何在 HTML 中搜索特定字符串.如何单击与python中的匹配字符串相对应的链接



下面是我的HTML数据。我想在我的 HTML 数据中的所有 tr 块中递归搜索"成功",然后单击链接"Klm_ud-gfd_hg_ghty_A_ghy",以便它移动到下一页

        <tr class="even">
            <td id="BuildSumBody"><a href="BuildDetails.pl?buildID=35182">Klm_ud-gfd_hg_ghty_A_ghy</a></td>
            <td id="BuildSumBody">Success</td>
            <td id="BuildSumBody"></td>
            <td id="BuildSumBody"><span class="userName">hare1 (R.)</span> <span class="userContact">user1</span></td>
            <td id="BuildSumBody"><span class="dateTime">Jan&nbsp;14,&nbsp;2016 08:39:53&nbsp;AM</span></td>
            <td id="BuildSumBody"><span class="dateTime">Jan&nbsp;14,&nbsp;2016 09:15:03&nbsp;AM</span></td>
            <td id="BuildSumBody">ghf</td>
            <td id="BuildSumBody">Dime</td>
            <td id="BuildSumBody">35182</td>
        </tr>

谁能帮忙。

看看 HTMLParser 遍历你的 HTML 树和 urllib 从链接中获取内容。

最新更新