@@ -19,20 +19,19 @@ var agreementUrl = casper.cli.get(2);
1919var downloadUrl = casper . cli . get ( 3 ) ;
2020var downloaded = false ;
2121
22+ phantom . addCookie ( {
23+ 'name' : 'oraclelicense' ,
24+ 'value' : '152021' ,
25+ 'domain' : 'oracle.com'
26+ } ) ;
27+
2228casper . start ( ) ;
2329// TODO: Error handling.
2430
25- // Accept the license agreement.
26- casper . thenOpen ( agreementUrl , function ( ) {
27- // this.echo("Accepting License");
28- this . evaluate ( function ( ) {
29- acceptAgreement ( window . self ) ;
30- } ) ;
31- } ) ;
3231
3332// Try to access the download page, wait for redirection and submit the login form.
3433casper . thenOpen ( downloadUrl ) . waitForUrl ( / s i g n o n \. j s p $ / , function ( re ) {
35- // this.echo("Injecting Login Info");
34+ //this.echo("Injecting Login Info");
3635 this . evaluate ( function ( username , password ) {
3736 document . getElementById ( "sso_username" ) . value = username ;
3837 document . getElementById ( "ssopassword" ) . value = password ;
@@ -42,8 +41,9 @@ casper.thenOpen(downloadUrl).waitForUrl(/signon\.jsp$/, function (re) {
4241} ) ;
4342
4443casper . on ( "resource.received" , function ( resource ) {
44+ //this.echo("Received something: " + resource.url);
4545 if ( resource . url . indexOf ( "AuthParam" ) !== - 1 && ! downloaded ) {
46- // this.echo("DownloadUrl:");
46+ //this.echo("DownloadUrl:");
4747 // Print the download url.
4848 this . echo ( resource . url ) ;
4949 downloaded = true ;
0 commit comments