其实就是类型问题,强转一下就好了,加一个str()就行了
resp = requests.get(url=url,headers=head)
bs = BeautifulSoup(resp.text,'html.parser')
record = open('hello.txt','w+t',encoding='utf-8')
a = bs.find_all("a")
b = str(a)
record.write(b)
其实就是类型问题,强转一下就好了,加一个str()就行了
resp = requests.get(url=url,headers=head)
bs = BeautifulSoup(resp.text,'html.parser')
record = open('hello.txt','w+t',encoding='utf-8')
a = bs.find_all("a")
b = str(a)
record.write(b)