真相:
#!win32 only. no unix magic chars # coding=utf-8 # need pywin32 module import win32com.client bro = win32com.client.Dispatch("InternetExplorer.Application") # show window bro.Visible = True bro.Navigate("http://www.baidu.com") while bro.Busy: pass print bro.LocationName # MSDN: bro.Document is a DOM object doc = bro.Document logo = doc.getElementsByTagName('img')[0] logo.setAttribute('src', 'http://www.google.cn/intl/zh-CN/images/logo_cn.gif') logo.setAttribute('width', '286') logo.setAttribute('height', '110')
没有评论:
发表评论