function __construct($keyword, $page) { parent::__construct($keyword); $this->_dom = new simple_html_dom(); $this->_dom->load($this->get($page)); // convert to dom // get total number of this keyword $this->_total = $this->_dom->find('#scd_num', 0)->innertext; // get total number of this page $this->_number = $this->_dom->find('.wx-rb3'); $this->_number = count($this->_number); // find results $this->_dom = $this->_dom->find('.results', 0); }
function __construct($url) { // 如果数据库中可以查到对应url的配置,则载入,否则新建数据并载入 parent::__construct($url); }