Sample Header Ad - 728x90

How to move/hover mouse (not click) over a button on Safari by using Applescript

1 vote
1 answer
718 views
Can anybody tell me how to write an Applescript that can move or hover mouse over a Button on Safari? I've successfully made an Applescript that can click to the button but I don't know how to make the mouse just move there, not clicking. Because I need to download some images from a website that only appear when you hover your mouse over that button (that button can't be clicked). The website I want to get information (HTML Element) when execute the script: https://shopee.vn/Bút-line-đi-nét-chuyên-nghiệp-SAKURA-PIGMA-MICRON-12-size-(0.03-Brush)-BÁN-LẺ-i.22061868.886461468 My sucessfull click-to-the-button Applescript (This click to the second image on the left): tell application "Safari" do JavaScript "document.getElementsByClassName('_3ZDC1p').click();" in document 1 end tell or: to clickClassName(theClassName, elementnum) tell application "Safari" do JavaScript "document.getElementsByClassName('" & theClassName & "')[" & elementnum & "].click();" in document 1 end tell end clickClassName clickClassName("_3ZDC1p", 2) So can you tell me how to hover mouse over the button (but not clicking) in a similar way of script like these above? Notice the Button "1.0 Graphic" in the website above is faded, that means it can't be clicked but once you hover your mouse to it, the image on the left appear, i want to get that image so bad. The url of that image only appear when I hover the mouse cursor over that button "1.0 Graphic". I already know how to make script downloading image from URL. I just need to have a script that can do hovering mouse to that button ("1.0 Graphic") so the image can be seen to grab the url. Thanks you!
Asked by Zui Zui (111 rep)
Jun 11, 2020, 06:36 AM
Last activity: Jun 16, 2025, 11:04 AM