diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2017-12-06 11:45:51 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2017-12-06 11:45:51 +0100 |
commit | 1b3710f9586acca56c8384afe60e51b5ae16fe36 (patch) | |
tree | 8350a2e9e9dab34e32a83f4c3e876b0693a517fd /crocoite | |
parent | d6ce0f0b9aeb0b6700bf8199b50e38f208801b68 (diff) | |
download | crocoite-1b3710f9586acca56c8384afe60e51b5ae16fe36.tar.gz crocoite-1b3710f9586acca56c8384afe60e51b5ae16fe36.tar.bz2 crocoite-1b3710f9586acca56c8384afe60e51b5ae16fe36.zip |
Add flags to disable screenshot/DOM snapshot
Diffstat (limited to 'crocoite')
-rw-r--r-- | crocoite/cli.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crocoite/cli.py b/crocoite/cli.py index 52d3b27..62f488a 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -146,6 +146,8 @@ def main (): #parser.add_argument('--keep-tab', action='store_true', default=False, dest='keepTab', help='Keep tab open') parser.add_argument('--onload', default=[], action='append', help='Inject JavaScript file before loading page', metavar='FILE') parser.add_argument('--onsnapshot', default=[], action='append', help='Run JavaScript files before creating DOM snapshot', metavar='FILE') + parser.add_argument('--no-screenshot', default=True, action='store_false', help='Do not create a screenshot of the website', dest='screenshot') + parser.add_argument('--no-dom-snapshot', default=True, action='store_false', help='Do not create a DOM snapshot of the website', dest='domSnapshot') parser.add_argument('url', help='Website URL') parser.add_argument('output', help='WARC filename') @@ -191,12 +193,14 @@ def main (): l.stop () - script = loadScripts (args.onsnapshot) - writeScript ('onsnapshot', script, writer) - l.tab.Runtime.evaluate (expression=script, returnByValue=True) - writeDOMSnapshot (l.tab, writer) + if args.domSnapshot: + script = loadScripts (args.onsnapshot) + writeScript ('onsnapshot', script, writer) + l.tab.Runtime.evaluate (expression=script, returnByValue=True) + writeDOMSnapshot (l.tab, writer) - writeScreenshot (l.tab, writer) + if args.screenshot: + writeScreenshot (l.tab, writer) return True |