如何在浏览器中模拟按钮单击?

发布于 2024-07-29 19:00:54 字数 250 浏览 8 评论 0原文

我想模拟网站上的按钮单击(不是我的网站,www.gfainfo.com)。

他们希望页面出现在展会上的笔记本电脑上,并且不想一遍又一遍地单击“重播视频”按钮。

单击“开始”按钮时,视频将首次显示。 我希望视频循环显示。 有什么建议么? 视频结束时会显示“重播视频”按钮。 我需要用“宏”或其他东西点击它,这样它就会一遍又一遍地播放。

他们可以单击“开始”按钮来开始视频,他们只需要反复单击“重播视频”按钮即可。

I want to simulate a button click on a website (not mine, www.gfainfo.com).

They want the page appearing on a laptop at their tradeshow and don't want to have to click the "Replay Video" button over and over again.

When the "start" button is clicked the video displays the first time. I want the video to display in a loop. Any suggestions? At the end of the video a "Replay Video" button is displayed. I need to click it with a "macro" or something so it will play over and over.

They can click the "start" button to get the video started, they just need the "Replay Video" button clicked over and over.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

执着的年纪 2024-08-05 19:00:54

右键单击此下载视频(此链接是您的实际健身视频),然后使用 Adobe Media Player 播放它。

我使用 Fiddler 捕获视频的 URL。

但如果您实际上为这些人工作,您确实应该能够直接从他们那里获得更高质量的视频。

自动点击“重播”是一个糟糕的主意......我建议使用两个屏幕。 一个播放视频,另一个显示网站。

Right click this to download the video (this link is your actual fitness video) and then use Adobe Media Player to play it.

I used Fiddler to capture the URL for the video.

But if you're actually working for these people you really ought to be able to get a higher quality video from them directly.

Automatically clicking 'replay' is a terrible idea... I'd suggest two screens. One playing the video and the other showing the website.

羞稚 2024-08-05 19:00:54

好的,这是一个编程问答网站,所以我将提供一个编程答案,

由于没有目标编程语言,我当然会使用 java。

import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class ClickAgain {

    public static void main( String [] args ) throws AWTException {

        final Robot robot = new Robot();
        int x = Integer.parseInt( args[0] );
        int y = Integer.parseInt( args[1] );
        long duration = Long.parseLong( args[2] );

        Timer timer = new Timer();

        timer.schedule( new TimerTask(){
            public void run(){
                robot.mouseMove( x, y );
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
            }
        }, 5000, duration );
    }
}

该程序的作用是每 N 秒(实际上是毫秒)在同一位置单击一次。

您只需将其调用为:

java ClickAgain 300 400 60000

单击屏幕的坐标 300,400,然后每分钟再次单击一次(1 分钟 = 60000 毫秒)

Ok, this is a programming Question/Answer site, so I'm going to provide a programming answer,

Since there is no target programming language I'm going to use java of course.

import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class ClickAgain {

    public static void main( String [] args ) throws AWTException {

        final Robot robot = new Robot();
        int x = Integer.parseInt( args[0] );
        int y = Integer.parseInt( args[1] );
        long duration = Long.parseLong( args[2] );

        Timer timer = new Timer();

        timer.schedule( new TimerTask(){
            public void run(){
                robot.mouseMove( x, y );
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
            }
        }, 5000, duration );
    }
}

What that program does, is click every N seconds ( milliseconds actually ) in the same place.

You just invoke it as:

java ClickAgain 300 400 60000

To click on coordinates 300,400 of the screen and click again every minute ( 1 min = 60000 milliseconds )

独行侠 2024-08-05 19:00:54

如果您确实想在浏览器中显示它,而不是像 Simon 建议的那样使用媒体播放器,您可以看看 iMacros,它为包括 Firefox 和 IE 在内的许多平台执行浏览器脚本。 不过,我还没有尝试过使用 Flash 动画。

If you really want to display it in a browser, rather than using a media player as Simon suggests, you could take a look at iMacros, which does browser scripting for a number of platforms including Firefox and IE. I haven't tried it with Flash animations, though.

那支青花 2024-08-05 19:00:54

我能想到的专门模拟重复点击的最简单方法是 AutoIt v3 脚本,如下所示:

While True
    MouseClick("primary", 160, 120)  ; button, x, y
    Sleep(60000)                     ; milliseconds
WEnd

该脚本将方便地创建一个托盘图标,您可以从中暂停或终止它。

也就是说,下载视频并独立播放会更好,而获得专门用于标牌的更高质量的视频可能会更好。

The easiest approach I can think of to specifically simulate repeated clicking is an AutoIt v3 script something like this:

While True
    MouseClick("primary", 160, 120)  ; button, x, y
    Sleep(60000)                     ; milliseconds
WEnd

The script will conveniently create a tray icon from which you can pause or kill it.

That said, downloading the video and playing it stand-alone is better, and obtaining a higher quality video specifically for signage use is probably way better.

她比我温柔 2024-08-05 19:00:54

我曾经使用任何自动单击鼠标的程序(例如自动鼠标答题器)来执行此操作。
问题是你的电脑必须保持打开状态,网页必须可见,你不能做其他事情。

有谁知道一种简单的方法可以通过免费的公共网站(论坛或网络提供商)使用脚本或类似的东西来做到这一点?
也许将点击写成宏。
我想模拟上午 9 点到晚上 9 点随机时段的点击。

I use to do it with any program that automate Mouse clicks such as Automouse clicker.
The problem is that your computer has to stay turned on, and the web page has to be visible, you can't do other things.

Does anybody know an easy way to do it from a free public web site (forum o web provider) with a script or something like that?
Maybe writing the clicks as a macro.
I would like to simulate clicks at random periods from 9am to 9pm.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文