[pyar] Filtrar por valor de un tag con lxml y xpath

Nicolas Rebagliati nicolas.rebagliati en aenima-x.com.ar
Mie Mayo 20 12:32:43 ART 2015


Listo ya lo encontré jajaja

Gracias!

2015-05-20 12:24 GMT-03:00 Nicolas Rebagliati <
nicolas.rebagliati en aenima-x.com.ar>:

> Alguien sabe si se puede hacer esto?
> filtrar nodos por valor de un atributo es facil, pero no encontre como
> filtrar por el contenido de un tag.
> ejemplo
>
> <StatusBoard>
>   <ServerStatus>
>     <ServerName>agarve11</ServerName>
>     <Type>getAplic</Type>
>     <Status>yellow</Status>
>     <TestFlags></TestFlags>
>     <LastChange>Wed May 20 01:43:12 2015</LastChange>
>     <LogTime>Wed May 20 11:55:05 2015</LogTime>
>     <ValidTime>Wed May 20 13:55:05 2015</ValidTime>
>     <AckTime>N/A</AckTime>
>     <DisableTime>N/A</DisableTime>
>     <Sender>10.26.235.20</Sender>
>     <Cookie>238140</Cookie>
>     <MessageSummary><![CDATA[status+2h agarve11.getAplic yellow Wed May 20
> 11:55:05 ART 2015]]></MessageSummary>
>   </ServerStatus>
>   <ServerStatus>
>     <ServerName>agarvi12</ServerName>
>     <Type>getAplic</Type>
>     <Status>yellow</Status>
>     <TestFlags></TestFlags>
>     <LastChange>Wed May 20 01:46:33 2015</LastChange>
>     <LogTime>Wed May 20 11:53:34 2015</LogTime>
>     <ValidTime>Wed May 20 13:53:34 2015</ValidTime>
>     <AckTime>N/A</AckTime>
>     <DisableTime>N/A</DisableTime>
>     <Sender>10.26.239.20</Sender>
>     <Cookie>716448</Cookie>
>     <MessageSummary><![CDATA[status+2h agarvi11.getAplic yellow Wed May 20
> 11:53:34 ART 2015]]></MessageSummary>
>   </ServerStatus>
> </StatusBoard>
>
> Quiero todos los nodos: ServerStatus que tienen el valor agarve11 en
> ServerName.
>
> Se puede hacer eso?
> O no me queda otra que iterar?
>
>
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20150520/5c53f3df/attachment.html>


More information about the pyar mailing list