我正在尝试使用 goutte 从 html 文件中提取特定值
$client = new Client();
$crawler = $client->request('GET', 'http://localhost:8081/app_dev.php');
$htmlContent= $crawler->filter('label')->last()->html();
var_dump($htmlContent);die();
在这种情况下,我得到了片段:
<input type="password" maxlength="40" myfield1="KqewkKAFyk7Vmsy" >
我想提取myfield1
a 的值。我该如何实现?
我已经尝试过但没有成功(结果为NULL):
$htmlContent= $crawler->filter('label')->last()->attr('myfield1');