Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / site_compare / scrapers / chrome / chrome01970.py
blob2f237fa4df459f650a86d20b1f4b63351ff886e8
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Does scraping for versions of Chrome up to 0.1.97.0."""
7 from drivers import windowing
9 import chromebase
11 # Default version
12 version = "0.1.97.0"
15 def GetChromeRenderPane(wnd):
16 return windowing.FindChildWindow(wnd, "Chrome_BrowserWindow")
19 def Scrape(urls, outdir, size, pos, timeout=20, **kwargs):
20 """Invoke a browser, send it to a series of URLs, and save its output.
22 Args:
23 urls: list of URLs to scrape
24 outdir: directory to place output
25 size: size of browser window to use
26 pos: position of browser window
27 timeout: amount of time to wait for page to load
28 kwargs: miscellaneous keyword args
30 Returns:
31 None if succeeded, else an error code
32 """
33 chromebase.GetChromeRenderPane = GetChromeRenderPane
35 return chromebase.Scrape(urls, outdir, size, pos, timeout, kwargs)
38 def Time(urls, size, timeout, **kwargs):
39 """Forwards the Time command to chromebase."""
40 chromebase.GetChromeRenderPane = GetChromeRenderPane
42 return chromebase.Time(urls, size, timeout, kwargs)