这个是那个认证需要提交一个采集百度搜索结果第三条的代码
已经略过了广告位
直接复制粘贴到UIbot里面运行就完事了!
我是在2019年6~7月左右写的。。。也许他们的题目后面会改变,如果没变的话,提交这份代码就完事了。至于答题的我就帮不了大家了。
去看一看他们官方的教程也很容易就过了,我大概花了两天时间看了一下他们的教程就过了他们的工程师认证。
UIbot现在的大方向跟我去年提的一个人干十个人活的思路大体一致
不过他们的技术领先我不晓得多少年,直接搞了个开发语言平台出来。牛逼。。。。
对技术感兴趣又不懂技术的可以也可以去学学。可视化的编程很容易入手。虽然实现的功能效率上来讲是慢了。可是协议也不是一朝一夕就能懂的,学会按键精灵或者uibot也基本能满足正常日常办公需求了。
dim hWeb = ""
dim arrayData = ""
dim iRet = ""
dim sRet = ""
dim a=0
hWeb = WebBrowser.Create("chrome","https://www.baidu.com/",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
#icon("@res:ngsjejhe-8i52-gd87-24ku-j72assea91df.png")
UiElement.SetValue({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":{"tagName":"INPUT","attrMap":{"tag":"INPUT","id":"kw"},"index":0}},"uibot",{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
#icon("@res:b0o4u8ln-pqit-ks1p-u879-60pv2bapp22r.png")
Keyboard.PressKey({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":{"tagName":"INPUT","attrMap":{"tag":"INPUT","id":"su"},"index":0}},"Enter",10,10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sKeyModifiers":[],"sSimulate":"simulate"})
arrayData = UiElement.DataScrap({"html":{"attrMap":{"id":"content_left","tag":"DIV"},"index":0,"tagName":"DIV"},"wnd":[{"app":"chrome","cls":"Chrome_WidgetWin_1","title":"*"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}]},{"Columns":[{"props":["url"],"selecors":[{"index":0,"prefix":"","tag":"div","value":"div"},{"className":"t","index":0,"prefix":">","tag":"h3","value":"h3.t"},{"className":"","index":0,"prefix":">","tag":"a","value":"a"}]}],"ExtractTable":0},{"objNextLinkElement":"","iMaxNumberOfPage":5,"iMaxNumberOfResult":-1,"iDelayBetweenMS":1000,"bContinueOnError":false})
For i = 0 To 10 step 1
//TracePrint arrayData[i][0]
iRet = InStr(arrayData[i][0],"php",0,false)
//TracePrint iret
If iret=0
a=a+1
//TracePrint a,i
if a=3
//TracePrint arrayData[i][0]
File.Create("d://数据.txt")
File.Write("d://数据.txt",arrayData[i][0] ,"utf-8")
End If
End If
Next