Attributes ---------- You can play with the attributes with the jquery API:: >>> p = pq('

')('p') >>> p.attr("id") 'hello' >>> p.attr("id", "plop") [] >>> p.attr("id", "hello") [] Or in a more pythonic way:: >>> p.attr.id = "plop" >>> p.attr.id 'plop' >>> p.attr["id"] = "ola" >>> p.attr["id"] 'ola' >>> p.attr(id='hello', class_='hello2') [] >>> p.attr.class_ 'hello2' >>> p.attr.class_ = 'hello'