Even better!
Thanks.
On 28/05/2022 12:28, Pedro Andres Aranda Gutierrez wrote:
Maybe even easier: string() in the XPATH:
===
description = tree.xpath('string(//meta[@name="description"]/@content)')
print(description)
===
best, /PA
On Fri, 27 May 2022 at 19:03, <[email protected]> wrote:
For others' benefit:
=======
description = tree.xpath("//meta[@name='description']/@content")
print(description[0])
=======
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]