Code Monkey home page Code Monkey logo

gemini's People

Contributors

martende avatar sscarduzio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gemini's Issues

Example not working

Not sure if it's because I'm using a more recent phantomjs binary, but this:

import akka.gemini.PhantomExecutor
import akka.actor.ActorSystem
import scala.concurrent.duration._

object Hi extends App {
    implicit val system = ActorSystem("MySystem")
    PhantomExecutor.initEnvironment

    val p = PhantomExecutor(isDebug=true)


    scala.concurrent.Await.result({
      p.open("https://www.google.com")
    },10 seconds)

    p.render("screen.png")
    p.close()

    println("Screenshot screen.png done.")
    system.shutdown()

}

Using this

phantom {
  // Path to binary phantomjs file - this repo produces 64bit compiled for ubuntu jessie bin
  // bin/phantomjs: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=6d1ee78f9e4370d6a33ebcb2cf989be26d4961e5, not stripped

  bin = "/usr/local/bin/phantomjs"
  // Some Extra args for phantomjs
  //args  =["--proxy=127.0.0.1:3128"]
  args = []
}

throws this:

[INFO] [09/13/2016 16:40:50.878] [MySystem-akka.actor.default-dispatcher-2] [akka://MySystem/user/PhantomExecutor-1] OpenUrl 'https://www.google.com'
Exception in thread "main" java.util.concurrent.TimeoutException: Futures timed out after [10 seconds]
    at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
    at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
    at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:190)
    at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53)
    at scala.concurrent.Await$.result(package.scala:190)
    at Hi$.delayedEndpoint$Hi$1(Main.scala:15)
    at Hi$delayedInit$body.apply(Main.scala:8)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.App$class.main(App.scala:76)
    at Hi$.main(Main.scala:8)
    at Hi.main(Main.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

What version of phantomjs did you test this with?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.