Reputation: 51
I'm thinking to create a script which can:
I've tried the following code but it can only do the first step, could anyone help me with this?
#include <AutoItConstants.au3>
ShellExecute("https://www.amazon.com")
MouseWheel($MOUSE_WHEEL_DOWN,10)
sleep(100)
MouseWheel($MOUSE_WHEEL_UP,10)
Thank you very much!
Upvotes: 2
Views: 3239
Reputation: 513
Browser window out of focus in your script.
Try this code:
#include <IE.au3>
$oIE = _IECreate("http://amazon.com")
$oIE.document.parentwindow.scroll(0,500)
Or if who want to use MouseWheel
(you must put mouse cursor to window area):
ShellExecute("https://www.amazon.com")
WinWaitActive("Amazon.com","")
$aPos = WinGetPos("Amazon.com","")
MouseMove($aPos[0]+($aPos[2]/2),$aPos[1]+($aPos[3]/2))
sleep(100)
MouseWheel($MOUSE_WHEEL_DOWN,10)
sleep(100)
MouseWheel($MOUSE_WHEEL_UP,10)
Upvotes: 1