0
我要在以下链接http://gepris.dfg.de/gepris/projekt/268853字符串迈克尔博士教授Eiermann从类别beteiliger Wissenschaftler提取。 Xpath查询必须如何正确。从输出我得到的字符串Fachliche ZuordnungXpath查询与scrapy
代码段使用XPath查询:
start_urls =['http://gepris.dfg.de/gepris/projekt/268853',]
def parse(self, response):
for sel in response.xpath("//*[contains(@class,'content_frame')]/*[@id='projektbeschreibung']"):
lianjia = lianjiaItem()
lianjia['Projekttitel'] = sel.xpath("//div/div/span/text()").extract()
@DaniiilMashkin sel.xpath声明(Projekttitel),保持不变? – user3786117
不,xpath返回字符串数组,您不需要使用另一个xpath。 –