颜栩栩 发表于 2020-5-6 11:42:39

【python】将输出结果保存到txt:

import requests
url = "https://voice.baidu.com/act/newpneumonia/newpneumonia/?from=osari_pc_1"
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.14 Safari/537.36 Edg/83.0.478.13"}
html = requests.get(url=url,headers=headers).content.decode()
with open('C:/Users/admin/Desktop/application/22.txt','w') as f:
    f.write(html)
    f.close()

颜栩栩 发表于 2020-5-22 11:23:18

【SQL】查询结果导出csv换行出错的处理
SELECT
      ,
      ,[关键词]
      ,[百科标题]
          ,REPLACE(REPLACE([简介], CHAR(10) , '<br>'), CHAR(13) , '<br>') [简介]
FROM ..


可用如上语句把回车符和换行符替换
页: 1 [2]
查看完整版本: 刚开始学python QAQ开个会员激励一下寄几!!