Elements and Attributes

At this point, the DOM transcends the tree analogy. There are multiple types of nodes, or to phrase that within the context of the DOM extension, DOMNode has multiple subclasses. The main two you’ll be dealing with are DOMElement for elements and DOMAttr for attributes. Here are how these concepts apply to the example in the last section.

  • ul is the name of an element.
  • id is the name of an attribute of the ul element.
  • thelist is the value of the id attribute.
  • Foo and Bar are the values of the li elements.

© DOM Extension — Web Scraping

>>> Back to TABLE OF CONTENTS <<<
Category: Article | Added by: Marsipan (01.09.2014)
Views: 361 | Rating: 0.0/0
Total comments: 0
avatar