Beta冲刺3/3 进展及体会
一、项目进展
二、心得体会
团队合作是网页开发的要害,就像合伙开饭店一样,得密切合作才能让顾客满意。每个人需要互通消息、分工合理,一起审查代码,保证网站好用,最好能够记录下开发文档,有助于以后查阅。再说,持续部署和反馈很关键,保证工程质量。还有,团队合作需要尊重彼此,多交流,否则的话小组作业就会变成一个人的作业。到最后得总结开发的经验,改进不足。这些经验,以后项目中都能派上用场。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| import requests from bs4 import BeautifulSoup import csv
url = "https://yss.mof.gov.cn/2022zyczys/202203/t20220324_3797801.htm" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0" }
resp = requests.get(url, headers=headers)
resp.encoding = 'utf-8'
with open("./data/2022finance.csv", mode="w", newline="", encoding="utf-8-sig") as f: csvwriter = csv.writer(f)
page = BeautifulSoup(resp.text, "html.parser") table = page.find("table")
trs = table.find_all("tr")[2:] for tr in trs: tds = tr.find_all("td") name, num_20, num_20_1 = [td.text for td in tds[:3]] csvwriter.writerow([name, num_20, num_20_1])
print("over!")
|