【发布时间】:2019-04-26 20:20:20
【问题描述】:
我尝试使用下面的代码在此网页 (https://www.meleenumerique.com/scientist_comite) 上抓取人的名字 + 姓氏,但它不起作用。如何确定它有什么问题?
这是我写的代码
from lxml import html
import csv,os,json
import requests
url="https://www.meleenumerique.com/scientist_comite"
r=requests.get(url)
t=html.fromstring(r.content)
title=t.xpath('/html/head/title/text()')
#Create the list of speaker
speaker=t.xpath('//span[contains(@class,"speaker-name")]//text()')
print(title)
print("Speakers:",speaker)
【问题讨论】:
标签: python web-scraping python-requests lxml