mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-06-21 05:14:22 -04:00
Replace js evaluation with direct page navigation, add default for dump_queue
This commit is contained in:
parent
7d89d1bed1
commit
8afe7d90a2
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ def print_and_ack(body, message):
|
||||||
print(body['url'])
|
print(body['url'])
|
||||||
message.ack()
|
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:
|
with conn.Consumer(requests_queue, callbacks=[print_and_ack]) as consumer:
|
||||||
while True:
|
while True:
|
||||||
conn.drain_events()
|
conn.drain_events()
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Umbra:
|
||||||
|
|
||||||
with self.browser_lock:
|
with self.browser_lock:
|
||||||
self.send_command(method="Network.enable")
|
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
|
# XXX more logic goes here
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue