【发布时间】:2022-01-23 23:26:14
【问题描述】:
我假设在网站上获取所有教授的“电子邮件”的正确路径,但输出列表是[],这意味着路径中没有任何内容?真的不知道为什么:(
import requests
from lxml import etree
headers = {"User-Agent":""}
res = requests.get("https://www.csie.ntu.edu.tw/members/teacher.php?mclass1=110",headers=headers)
content = res.content.decode()
html = etree.HTML(content)
email = html.xpath('//li[@class="mail"]/a/text')
for e in email:
print(e)
非常感谢您的帮助。非常感谢社区。p>
【问题讨论】: