Skip to content

Instantly share code, notes, and snippets.

@tarappo
Created March 14, 2013 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarappo/8bc544a06d18c59ea230 to your computer and use it in GitHub Desktop.
Save tarappo/8bc544a06d18c59ea230 to your computer and use it in GitHub Desktop.
ログインするだけのスクリプト。
<?php
require_once "__init__.php";
$wd_host = 'http://localhost:4444/wd/hub';
$web_driver = new WebDriver($wd_host);
//ブラウザ指定
$session = $web_driver->session('chrome');
$session->open('http://www.facebook.com/');
//emailとpass入力
$session->element('id', 'email')->clear();
$session->element('id', 'email')->value(array('value' => str_split("your email")));
$session->element('id', 'pass')->clear();
$session->element('id', 'pass')->value(array('value' => str_split("your password")));
//ログイン
$session->element('id', 'u_0_3')->click();
sleep(10);
$session->close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment