3
for l in d.items('nl,de,en'):
   if l.tag()=='nl':
      dothis()

How can I find the tag associated with a pyquery object? The method tag() in the exaple above doesnt exist...

user104100
  • 41
  • 1
  • 6

1 Answers1

2

The right way to get the tag name is with is_() function.

for l in d.items('nl,de,en'):
   if l.is_('nl')
      dothis()

from the docs: https://pythonhosted.org/pyquery/modules/pyquery/pyquery.html#PyQuery.is

Hope it helped.

Idan Magled
  • 2,186
  • 1
  • 23
  • 33