Ejemplo n.º 1
0
 public function test_selector_or()
 {
     $sel = new HTMLSelector('p,div');
     $this->output($sel->toXPath() . "<br>\n");
     $sel = new HTMLSelector('#bar_error input');
     $this->output($sel->toXPath() . "<br>\n");
     $sel = new HTMLSelector('div > div');
     $this->output($sel->toXPath() . "<br>\n");
 }
Ejemplo n.º 2
0
 /**
  * Find the first element in the DOM based on a CSS selector
  * @param string $find A CSS selector
  * @return HTMLNode A qualifying node
  */
 public function find_one($find)
 {
     $expression = new HTMLSelector($find);
     $array = $this->query($expression->toXPath());
     return reset($array);
 }