新浪博客

Excel VBA 打开百度网页输入关键字并搜索

2013-12-05 00:47阅读:
Sub 百度搜索()
'Excel VBA 打开百度网页输入关键字并搜索
Dim KW, Su
With CreateObject('InternetExplorer.Application')
.Navigate '
http://www.baidu.com/'
.Visible = True
Do Until .readyState = 4
DoEvents
Loop
'Set KW = .document.getElementsByName('wd')
'KW.Item(0).Value = 'QQ'
.document.getElementsByName('wd').Item(0).Value = 'QQ' '等同上面2句
'Set Su = .document.getElementByIdx_x('f')
'Su.Submit
.document.getElementByIdx_x('f').Submit '等同上面2句
End With
Set Su = Nothing
Set KW = Nothing
End Sub

我的更多文章

下载客户端阅读体验更佳

APP专享