如何获取html中的title
url = 'http://www.yongdasbkj.com/'
resp = requests.get(url, verify=False)
html_string = resp.content.decode(automatic_detect(url))
# print(html_string)
html = etree.HTML(html_string)
# 获取titile
titles = html.xpath('//title')
for title in titles:
title = title.xpath('text()')
print(title)