Click here to Skip to main content
14,388,761 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hey Guys,

I want to write a code that should have the following function.

A website should be checked if an object (clickable button) is available.
If yes: click on it and leave the loop.
If not: reloaded the page.

I want to run the code with JavaScript (with GreaseMonkey).

What I have tried:

I have knowledge of Java, but I have problems with JavaScript.
I did a lot of research on the internet but did not find any helpful information.
The only thing that works so far is that the page is reloaded every half second.

setTimeout(function(){ location.reload(); }, 0.5*1000);

I am grateful for any help

Best regards
Richard MacCutchan 9-Nov-19 9:39am
Is this your website or someone else's?
Manyou099 9-Nov-19 10:20am
I would like to use the code on a ticket exchange. The tickets are being sold so fast that you have no chance to get them. That's why I want to try it that way.

Do not worry: I do not want to spam the website. The website also has a spam protection, if you refresh too fast you will be banned.
Richard MacCutchan 9-Nov-19 10:40am
Well I do not think you can do it with Javascript. You need a webscraper application that captures the webpage and activates the button by sending message back. Google for webscraper (plus your language of choice) for samples.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100