diff --git a/README.md b/README.md index b739ce1..58db62c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Install via pip from this repo. Run ===== "umbra" script should be in bin/. -Currently we create a browser and navigate to a single page, -then exit. We are receiving the network events, but don't yet -have anything to do with them. AMQP/RabbitMQ integration is next. - +load_url.py takes urls as arguments and puts them onto a rabbitmq queue +dump_queue.py prints resources discovered by the browser and sent over the return queue. +On ubuntu, rabbitmq install with `sudo apt-get install rabbitmq-server` should automatically +be set up for these three scripts to function on localhost ( the default amqp url ). diff --git a/bin/dump_queue.py b/bin/dump_queue.py index 3585064..9e31619 100755 --- a/bin/dump_queue.py +++ b/bin/dump_queue.py @@ -15,7 +15,7 @@ def print_and_ack(body, message): print(body['url']) message.ack() -with Connection(sys.argv[1]) as conn: +with Connection(sys.argv[1] if len(sys.argv) > 1 else "amqp://guest:guest@localhost:5672//") as conn: with conn.Consumer(requests_queue, callbacks=[print_and_ack]) as consumer: while True: conn.drain_events() diff --git a/umbra/umbra.py b/umbra/umbra.py index 30e7d85..b449d1a 100755 --- a/umbra/umbra.py +++ b/umbra/umbra.py @@ -70,7 +70,7 @@ class Umbra: with self.browser_lock: self.send_command(method="Network.enable") - self.send_command(method="Runtime.evaluate", params={"expression":"document.location = '%s';" % url}) + self.send_command(method="Page.navigate", params={"url": url}) # XXX more logic goes here time.sleep(10)