使用xpath抓取https://www.tsinghua.edu.cn/信息标题
时间: 2023-10-07 19:13:12 浏览: 174
可以使用Python的requests和lxml库来实现:
```python
import requests
from lxml import etree
url = 'https://www.tsinghua.edu.cn/'
response = requests.get(url)
html = etree.HTML(response.text)
title = html.xpath('//title/text()')[0]
print(title)
```
输出:
```
清华大学
```
阅读全文