用.的方式运行会报错
来自课程:Python爬虫从爪巴到爬
import requests
from bs4 import BeautifulSoup
#请求的地址
url = "http://www.gaokao.com/gkpic/"
#发起请求
resp = requests.get(url)
#拿到网页源代码
html = resp.content.decode("gbk")
#使用bs解析
soup = BeautifulSoup(html,"html.parser")
# print(html)
#通过. 的方式查找节点,同名的标签只能找到第一个
print(html.head)
老师,请问下为什么这个运行出来会报错?
报错行就是最后一行


