|
...
|
...
|
@@ -266,20 +266,9 @@ class Demo extends Command |
|
|
|
// }
|
|
|
|
public function handle(){
|
|
|
|
$html = '<a href="#" class="logo img-box"><img src="https://cdn.globalso.com/fiberglass-expert/logo.png" alt="logoz9j"></a>';
|
|
|
|
$doc = new \DOMDocument();
|
|
|
|
$doc->loadHTML($html);
|
|
|
|
|
|
|
|
$xpath = new \DOMXPath($doc);
|
|
|
|
$logoClass = 'logo';
|
|
|
|
$query = "//a[contains(concat(' ', normalize-space(@class), ' '), ' $logoClass ')]";
|
|
|
|
|
|
|
|
$result = $xpath->query($query)->item(0);
|
|
|
|
if ($result) {
|
|
|
|
$aTagContent = $doc->saveHTML($result);
|
|
|
|
echo $aTagContent;
|
|
|
|
} else {
|
|
|
|
echo "未找到符合条件的元素";
|
|
|
|
}
|
|
|
|
$dom = file_get_html('https://cdn.globalso.com/');
|
|
|
|
$texts = $dom->find("text");
|
|
|
|
dd($texts);
|
|
|
|
// $projectModel = new Project();
|
|
|
|
// $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]);
|
|
|
|
// foreach ($list as $v1){
|
...
|
...
|
|