正在显示
1 个修改的文件
包含
2 行增加
和
4 行删除
| @@ -266,10 +266,8 @@ class Demo extends Command | @@ -266,10 +266,8 @@ 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 | - $html = str_get_html($html); | ||
| 270 | - $dom = new \simple_html_dom_node(); //new simple_html_dom对象</p><p> | ||
| 271 | - $domHtml = $dom->load($html); | ||
| 272 | - $texts = $domHtml->find('a[class=logo]',0); | 269 | + $dom = str_get_html($html); |
| 270 | + $texts = $dom->find('a',0); | ||
| 273 | // $texts = $dom->find('a', 0); | 271 | // $texts = $dom->find('a', 0); |
| 274 | dd($texts); | 272 | dd($texts); |
| 275 | // $projectModel = new Project(); | 273 | // $projectModel = new Project(); |
-
请 注册 或 登录 后发表评论