1
如何從<strong id="reference">123</strong>
獲得123?從表單元素提取數據
像下面這樣的東西。
/**
* @Then /^I check reference in database$/
* @throws \Exception
*/
public function checkReferenceInDb()
{
$session = $this->getSession();
$page = $session->getPage();
$element = $page->find('css', //I think I should do something here to process the page content);
if (null === $element) {
throw new \Exception(sprintf('Could not evaluate CSS element"));
}
$id = //123 should be assigned to this and I'll do the rest
}
謝謝。按預期工作。 – BentCoder 2014-09-04 19:49:46