第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

正在回答

4 回答

class HtmlOutputer(object):
??? def __init__(self):
??????? self.datas=[]
???
??? def collect_data(self,data):
??????? if data is None:
??????????? return
??????? self.datas.append(data)
???????
??? def output_html(self):
??????? fout = open('output.html', 'w', encoding='utf-8')
??????? fout.write("<html>")
??????? fout.write("<head>")
??????? fout.write('<meta charset="UTF-8">')
??????? fout.write("</head>")
??????? fout.write("<body>")
??????? fout.write("<table>")
???????
??????? #ascii
??????? 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("</table>")
??????? fout.write("</body>")
??????? fout.write("</html>")

0 回復(fù) 有任何疑惑可以回復(fù)我~

Python2.X 默認(rèn)編碼方式為 ascii

0 回復(fù) 有任何疑惑可以回復(fù)我~

python3.4.4不存在編碼問(wèn)題

0 回復(fù) 有任何疑惑可以回復(fù)我~

這個(gè)貌似是python2 默認(rèn)的asc碼,python3 改成unicode了。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Python開(kāi)發(fā)簡(jiǎn)單爬蟲(chóng)
  • 參與學(xué)習(xí)       227603    人
  • 解答問(wèn)題       1284    個(gè)

本教程帶您解開(kāi)python爬蟲(chóng)這門神奇技術(shù)的面紗

進(jìn)入課程

output輸出問(wèn)題

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)