Skip to content

Commit

Permalink
coprocessor.phantomjs: Time out waiting load on separate value not wa…
Browse files Browse the repository at this point in the history
…it-time
  • Loading branch information
chfoo committed Jan 3, 2015
1 parent 4d80214 commit 12d02e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ What's New
==========

* Fixed NameError with PhantomJS proxy on Python 3.2.
* Fixed PhantomJS stop waiting for page load too early.
* Fixed ``--page-requisites`` exceeding ``--level``.
* Fixed infinite page requisite recursion when using ``--span-hosts-allow page-requisites``.
* Added ``--page-requisites-level``. The default max recursion depth on page requisites is now 5.
Expand Down
6 changes: 4 additions & 2 deletions wpull/coprocessor/phantomjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
('smart_scroll', True),
('snapshot', True),
('viewport_size', (1200, 1920)),
('paper_size', (2400, 3840))
('paper_size', (2400, 3840)),
('load_time', 60),
]
)
'''PhantomJS parameters
Expand All @@ -48,6 +49,7 @@
snapshot (bool): Whether to take snapshot files.
viewport_size (tuple): Width and height of the page viewport.
paper_size (tuple): Width and height of the paper size.
load_time (float): Maximum time to wait for page load.
'''


Expand Down Expand Up @@ -265,7 +267,7 @@ def wait_load(self):
_logger.debug('Wait load')

# FIXME: should this be a configurable option somewhere
timeout = self._params.wait_time * 2
timeout = self._params.load_time
start_time = time.time()

while self._load_state != 'finished' or self._resource_tracker.pending:
Expand Down

0 comments on commit 12d02e4

Please sign in to comment.