Skip to content

each and html not working as expected #4

Description

@najamkhn

each doesn't work properly.

>>> d = pq(url="http://www.google.com")
>>> d.find('div').each(lambda x: x.html())
[<div#mngb>, <div#gbar>, <div#guser>, <div.gbh>, <div.gbh>, <div#lga>, <div.ds>, <div#gac_scont>, <div>, <div#prm>, <div>, <div#fll>, <div#xjsd>, <div#xjsi>]
  • Should be returning the contents of innerHTML and of all the divs

Element objects have no htmlattribute when its required:

>>> for i in d.find('div'):
...   print i.html()
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
AttributeError: 'HtmlElement' object has no attribute 'html'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions