打赏

相关文章

Day7:requests 获取网页标题

`import requests from html.parser import HTMLParser class TitleParser(HTMLParser): def handle_starttag(self, tag, attrs): if tag == "title": self.in_title = True def handle_data(self, data): …

文件读写(一行一行)

`# 写入文件 with open("test.txt", "w") as f: f.write("第一行\n第二行") 读取并打印 with open("test.txt", "r") as f: for line in f: print(line.strip())` …

手机版浏览

扫一扫体验

微信公众账号

微信扫一扫加关注

返回
顶部