OLD | NEW |
1 #!/usr/bin/python2.4 | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 3 # found in the LICENSE file. |
5 | 4 |
6 """Command for scraping images from a URL or list of URLs. | 5 """Command for scraping images from a URL or list of URLs. |
7 | 6 |
8 Prerequisites: | 7 Prerequisites: |
9 1. The command_line package from tools/site_compare | 8 1. The command_line package from tools/site_compare |
10 2. Either the IE BHO or Firefox extension (or both) | 9 2. Either the IE BHO or Firefox extension (or both) |
11 | 10 |
12 Installation: | 11 Installation: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 filename = windowing.URLtoFilename(url, command["--outdir"], ".bmp") | 50 filename = windowing.URLtoFilename(url, command["--outdir"], ".bmp") |
52 image.save(filename) | 51 image.save(filename) |
53 | 52 |
54 if command["--logfile"]: log_file = open(command["--logfile"], "w") | 53 if command["--logfile"]: log_file = open(command["--logfile"], "w") |
55 else: log_file = None | 54 else: log_file = None |
56 | 55 |
57 browser_iterate.Iterate(command, ScrapeResult) | 56 browser_iterate.Iterate(command, ScrapeResult) |
58 | 57 |
59 # Close the log file and return. We're done. | 58 # Close the log file and return. We're done. |
60 if log_file: log_file.close() | 59 if log_file: log_file.close() |
61 | |
OLD | NEW |