Обговорення » Creation Requests
Need help with a script
To refresh a page every 3 minutes, you only need to use this function:
setInterval(function(){ location.reload(); }, (3 * 60 * 1000));
The function uses miliseconds, so the 3 minutes are (3 * 60 * 1000) miliseconds. To change to 5 minutes, you only need to change the "3" by a "5".
To make the click, you first need to find the video control, and then only need to use this function:
document.querySelector("#example").click();
In this example, you search for a video control named with an id="example".
You can search by id: #id_example
,
or by class: .class_example
,
or by tag: img
,
and you can mix multiple selectors: body .content #mainvideo img.playbutton
.
Every website is different, so nobody can give you more help without more information.
leoncastro, since the page is reloading you could use setTimeout. ;)
Yes, right. Thanks for the remark.
Need help with a script
Hi, i am looking for someone who can right a simple script for me.
I just need it to refresh certain page every few mins
and click this play button on a video.
Thanks in advance :)