无法通过XPath访问某个特定网页的dl,dt或dd(赛门铁克病毒数据库)

时间:2015-04-06 06:44:21

标签: html xpath

我是新手使用xpath并尝试从网页http://www.symantec.com/security_response/writeup.jsp?docid=2000-122015-2208-99

中提取数据

xpath //dl//dt//dd为我返回空列表,而//h1//h2//div,{{1} }},//a以及我能想到的其他所有尝试按预期工作的内容。 //p//dl//dt xpath适用于其他具有相关标签的网页。

为什么会对此网页发生这种情况,如何访问dl,dt和dd节点?

我的(python)代码的相关部分是

//dd

除了from lxml import html import requests url = 'http://www.symantec.com/security_response/writeup.jsp?docid=2000-122015-2208-99?' htmlp = requests.get(url) tree = html.fromstring(htmlp.text) dlList = tree.xpath('//dl') #How I'm checking to see if dlList is empty print len(dlList) print dlList[0] //dl//dt之外,我似乎还可以使用。 //dd等也不起作用。

0 个答案:

没有答案