2021-05-23
bs4使用1.拿到页面源代码2.使用bs4进行解析,拿到数据首先基本框架import requestsfrom bs4 import BeautifulSoupimport csvurl = "http://www.xinfadi.com.cn/marketanalysis/0/list/1.shtml"resp = requests.get(url)f = open("菜价.csv", mode="w",encoding="