Re: [請益] 請問VBA將網頁下拉的寫法軟工
Sub OpenAndScrollChrome()
'啟動Chrome瀏覽器
Shell "C:\Program Files\Google\Chrome\Application\chrome.exe"
'等待Chrome開啟
Application.Wait (Now + TimeValue("00:00:05"))
'模擬下箭頭鍵
Application.SendKeys "{DOWN 5}", True
'等待30秒
Application.Wait (Now + TimeValue("00:00:30"))
'關閉當前網頁(Ctrl+W)
Application.SendKeys "^{w}", True
End Sub
-----
Sent from JPTT on my iPhone
--
Every man for himself and God against them all.
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.125.121 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1694518580.A.7F3.htmlbrucetu1樓喔 09/12 20:47
→ neo52772樓酷耶來試試看 09/12 23:25
lchcoding3樓推,難得有程式碼可以看... 09/13 10:38
B09886980884樓所以他的問題是少一個true? 09/13 11:01
kero9612405樓想詢問 down 5的意思是什麼呢 09/13 12:10
TSMCfabXX6樓重複次數 09/13 12:18
neo52777樓原來是這樣的思路 09/13 15:21
erpp8樓感謝大神,但是試了還是不行 09/13 19:04
→ 本人9樓哪裡不行? 09/13 19:27
erpp10樓down5那邊不行,網頁無法往下 09/13 20:54
試試看
For i = 1 To 5
Application.SendKeys "{DOWN}", True
Application.Wait (Now + TimeValue("00:00:01"))
Next i
Chrome要是目前活動窗口
不然指令會被送到別的地方
→ Firstshadow11樓改Application.SendKeys "{PGDN 5}", True勒? 09/14 01:24
peter9812樓此id必噓 09/14 04:38