我可以使用xpath查询从标记中排除onclick值吗?

时间:2014-04-14 22:08:21

标签: python xpath

这是我的xpath查询:

'//div[contains(@class,"group") and contains(@class,"group-even")]//div[descendant-or-self::text()]'

结果:

<div> 
<h3>Online Services</h3> 
<ul> 
<li><a href="https://www.domain.com/shipping/label.htm" onclick="dcsMultiTrack('DCS.dcsuri','/POLocator/', 'WT.ti','Link: POLocator: OnlineServices: PrintLabelwPostge', 'WT.z_section','POLocator', 'WT.z_link','OnlineServices_PrintLabelwPostge','WT.dl','1000')">Print a Label with Postage ›</a></li>
<li><a href="https://www.domain.com/shipping/carrierpickup/welcome.htm" onclick="dcsMultiTrack('DCS.dcsuri','/POLocator/', 'WT.ti','Link: POLocator: OnlineServices: SchedPckup', 'WT.z_section','POLocator', 'WT.z_link','OnlineServices_SchedPckup','WT.dl','1000')">Schedule a Pickup ›</a></li> 
 </ul> 
 /div>

是否可以从标签中排除onclick =“value”?

0 个答案:

没有答案