使用Python获取IE历史列表

April 02, 2015

Tags:Python

用C#实现起来都好麻烦,几百行代码吐血。果断用起我大Python

PS:注意哈,我这里用了PyWin32,很方便的访问WinAPI

# coding:utf-8

# Author: GeekGao

# Date: 2015-03-01

from win32inet import *

def get_ie_history():
    l = []
    handle = FindFirstUrlCacheEntry('visited')
    try:
        while handle:
            l.append(FindNextUrlCacheEntry(handle[0]))
    except:
        pass # Or you can do something else here.
    return len(l), l

· EOF ·