課程
/后端開發(fā)
/Python
/Python開發(fā)簡單爬蟲
如題。
2018-12-02
源自:Python開發(fā)簡單爬蟲 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()
舉報(bào)
本教程帶您解開python爬蟲這門神奇技術(shù)的面紗
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2019-09-06