时间:2021-07-01 10:21:17 帮助过:6人阅读
new Session(new GoutteDriver(new GoutteClient())), 'goutte2' => new Session(new GoutteDriver(new GoutteClient())), 'custom' => new Session(new MyCustomDriver($startUrl)))); // set the default session name$mink->setDefaultSessionName('goutte2'); // visit a page$mink->getSession()->visit($startUrl); // call to getSession() without argument will always return a default session if has one (goutte2 here)$mink->getSession()->getPage()->findLink('Downloads')->click();echo $mink->getSession()->getPage()->getContent(); // call to getSession() with argument will return session by its name$mink->getSession('custom')->getPage()->findLink('Downloads')->click();echo $mink->getSession('custom')->getPage()->getContent(); // this all is done to make possible mixing sessions$mink->getSession('goutte1')->getPage()->findLink('Chat')->click();$mink->getSession('goutte2')->getPage()->findLink('Chat')->click();
项目主页:http://www.open-open.com/lib/view/home/1430832116976