Exemple #1
0
def main():
    # We're being invoked rather than imported, so run some tests
    path = r"c:\sitecompare\scrapes\ie7\7.0.5380.11"
    windowing.PreparePath(path)

    # Scrape three sites and save the results
    Scrape([
        "http://www.microsoft.com", "http://www.google.com",
        "http://www.sun.com"
    ], path, (1024, 768), (0, 0))
    return 0
Exemple #2
0
                if not windowing.WaitForProcessExit(proc, timeout):
                    windowing.EndProcess(proc)
                    load_time = "crashed"
                proc = None
        except pywintypes.error:
            load_time = "crashed"
            proc = None

        ret.append((url, load_time))

    # Send an alt-F4 to make the browser close; if this times out,
    # we've probably got a crash
    if proc:
        keyboard.TypeString(r"{\4}", use_modifiers=True)
        if not windowing.WaitForProcessExit(proc, timeout):
            windowing.EndProcess(proc)

    return ret


if __name__ == "__main__":
    # We're being invoked rather than imported, so run some tests
    path = r"c:\sitecompare\scrapes\ie7\7.0.5380.11"
    windowing.PreparePath(path)

    # Scrape three sites and save the results
    Scrape([
        "http://www.microsoft.com", "http://www.google.com",
        "http://www.sun.com"
    ], path, (1024, 768), (0, 0))