Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python2.4 | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2006-2008 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 | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Does scraping for Firefox 2.0.""" | 6 """Does scraping for Firefox 2.0.""" |
| 7 | 7 |
| 8 import pywintypes | 8 import pywintypes |
| 9 import time | 9 import time |
| 10 import types | 10 import types |
| 11 | 11 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 if proc: | 225 if proc: |
| 226 count = 0 | 226 count = 0 |
| 227 while (len(windowing.FindChildWindows(0, "MozillaUIWindowClass")) | 227 while (len(windowing.FindChildWindows(0, "MozillaUIWindowClass")) |
| 228 and count < 5): | 228 and count < 5): |
| 229 keyboard.TypeString("[w]", True) | 229 keyboard.TypeString("[w]", True) |
| 230 time.sleep(1) | 230 time.sleep(1) |
| 231 count = count + 1 | 231 count = count + 1 |
| 232 return ret | 232 return ret |
| 233 | 233 |
| 234 | 234 |
| 235 if __name__ == "__main__": | 235 if __name__ == "__main__": |
|
Alexander Potapenko
2011/11/24 07:53:02
Missing main() here: the code below is not a one-l
| |
| 236 # We're being invoked rather than imported, so run some tests | 236 # We're being invoked rather than imported, so run some tests |
| 237 path = r"c:\sitecompare\scrapes\Firefox\2.0.0.6" | 237 path = r"c:\sitecompare\scrapes\Firefox\2.0.0.6" |
| 238 windowing.PreparePath(path) | 238 windowing.PreparePath(path) |
| 239 | 239 |
| 240 # Scrape three sites and save the results | 240 # Scrape three sites and save the results |
| 241 Scrape( | 241 Scrape( |
| 242 ["http://www.microsoft.com", "http://www.google.com", | 242 ["http://www.microsoft.com", "http://www.google.com", |
| 243 "http://www.sun.com"], | 243 "http://www.sun.com"], |
| 244 path, (1024, 768), (0, 0)) | 244 path, (1024, 768), (0, 0)) |
| 245 | |
| OLD | NEW |