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 from 0.1.101.0 up."""
7 from drivers import windowing
15 def GetChromeRenderPane(wnd):
16 return windowing.FindChildWindow(wnd, "Chrome_TabContents")
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.
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
31 None if succeeded, else an error code
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)