【发布时间】:2014-12-29 04:11:34
【问题描述】:
我正在尝试从元素中获取 text 值,并且尝试了很多变化。没有任何效果..这是我最近的尝试:
$totalFlightPrice = $row->elements($row->using('css selector')->value('span[class="totalPriceToBook"]'));
echo 'counted: '.count($totalFlightPrice)."\n";
foreach ($totalFlightPrice as $tp) {
echo 'text: '.$tp->text()."\n";
}
当我在 totalFlightPrice 上使用 var_dump 时,我正在接收对象,这意味着它能够找到 div。 但是当我使用 text 函数时没有返回任何内容。
这是我的 span 元素:
<span class="totalPriceToBook">382€</span>
【问题讨论】:
标签: php selenium selenium-webdriver phpunit