gpt4 book ai didi

Symfony 爬虫从下拉列表中选择标签属性

转载 作者:行者123 更新时间:2023-12-02 21:08:43 26 4
gpt4 key购买 nike

我需要在下拉菜单中定位“选定”属性,以便我可以比较标记为选定的项目是否是我需要选择的项目。你能帮我提供一些方法吗?我可以用什么来实现这个目的?

<option value="Title" selected>Title</option>
<option value="First Name">First Name</option>
<option value="Middle Name">Middle Name</option>

谢谢:)

最佳答案

我终于找到答案了 -

$crawler->filter('option[selected]')->attr('value');

对我有用:)

关于Symfony 爬虫从下拉列表中选择标签属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34673587/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com