Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @return bool|Cookie|null
- * @throws Exception
- */
- protected function auth()
- {
- $this->driver->get(self::AUTH_URL);
- $captcha_text = CaptchaService::solve_captcha('normal', $this->driver);
- $this->driver->findElement(WebDriverBy::id('loginform-email'))->sendKeys($this->account->email);
- $this->driver->findElement(WebDriverBy::id('loginform-password'))->sendKeys($this->account->password);
- $this->driver->findElement(WebDriverBy::id('loginform-verifycode'))->sendKeys($captcha_text);
- $this->driver->executeScript("document.getElementsByClassName('btn btn_default btn_action')[0].click()");
- sleep(3);
- $this->driver->wait()->until(WebDriverExpectedCondition::titleIs('Sent Msg - Статистика - Subscribe for future'));
- $PHPSESSID = $this->driver->manage()->getCookieNamed('PHPSESSID');
- $this->driver->manage()->addCookie($PHPSESSID);
- $this->account->phpsessid = $PHPSESSID->getValue();
- $this->account->save();
- return $PHPSESSID;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement