作者 lyh

gx

@@ -266,10 +266,12 @@ class Demo extends Command @@ -266,10 +266,12 @@ class Demo extends Command
266 // } 266 // }
267 public function handle(){ 267 public function handle(){
268 $html = '<div><a>23423424</a><a href="#" class="logo img-box"><img src="https://cdn.globalso.com/fiberglass-expert/logo.png" alt="logoz9j"></a></div>'; 268 $html = '<div><a>23423424</a><a href="#" class="logo img-box"><img src="https://cdn.globalso.com/fiberglass-expert/logo.png" alt="logoz9j"></a></div>';
269 - $dom = str_get_html($html);  
270 - $texts = $dom->find("a[class=logo]",0); 269 + $html = str_get_html($html);
  270 + $dom = new \simple_html_dom(); //new simple_html_dom对象</p><p>
  271 + $texts = $dom->load($html);
  272 +// $texts = $dom->find("a[class=logo]",0);
271 // $texts = $dom->find('a', 0); 273 // $texts = $dom->find('a', 0);
272 - dd($dom); 274 + dd($texts);
273 // $projectModel = new Project(); 275 // $projectModel = new Project();
274 // $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]); 276 // $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]);
275 // foreach ($list as $v1){ 277 // foreach ($list as $v1){