課程
/后端開發
/Python
/Python開發簡單爬蟲
如題。
2018-12-02
源自:Python開發簡單爬蟲 7-6
正在回答
fout?=?open("output.html",?'w',?encoding='utf-8') fout.write('<html>') #讓瀏覽器以utf-8的編碼顯示 fout.write("<meta?charset=\"utf-8\">") fout.write('<body>') fout.write('<table>') for?data?in?self.datas: ????fout.write("<tr>") ????fout.write("<td>%s</td>"?%?data['url']) ????fout.write("<td>%s</td>"?%?data['title']) ????fout.write("<td>%s</td>"?%?data['summary']) ????fout.write("</tr>") fout.write('</table>') fout.write('</body>') fout.write('</html>') fout.close()
舉報
本教程帶您解開python爬蟲這門神奇技術的面紗
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-09-06