Jump to content

Pressing A Button on a website Using CMD

Hey Guys 

 

I am currently working on a bat file and cant seem to get 1 last aspect to work

 

i made this Bat file to ping google tracert google and open a speedtest web page. whitch all works perfectly now i just want it to click the button on the speedtest to GO.

i have got the Curl and tried it in cmd by itself after the page has been loaded but nothing. if anyone knows how i can solve this issue please 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Shadleigh said:

Hey Guys 

 

I am currently working on a bat file and cant seem to get 1 last aspect to work

 

i made this Bat file to ping google tracert google and open a speedtest web page. whitch all works perfectly now i just want it to click the button on the speedtest to GO.

i have got the Curl and tried it in cmd by itself after the page has been loaded but nothing. if anyone knows how i can solve this issue please 

You could try to work around this, by for example using another program that can easily press the mouse in a certain spot on the screen. E.G. Autohotkey has a command to press the left mouse button in a certain position on the screen.

 

Another workaround would be using a different speedtest website, like fast.com (speedtest which immediately starts, but only shows download speed. it's hosted on the Netflix servers)

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

You can't do that directly from cmd, unless the browser has explicit command line parameters for it.

 

The page needs to load first, because the page may have javascript (code that runs in browser) which enables the button after some period of time after the page loads completely. For example, once the page is loaded, the page may download a list of servers that can be used for testing, and asks the browser to tell it the location of the user or falls back to using the local IP of the computer to guess where you're located, and using this information, it makes a list of servers closest to you.

This takes time. Once this is is done, the button will be enabled and you can click on it.

 

What you could do is to add an "auto click" extension to the browser (Firefox has plenty of these) and configure that extension to only click on website with domain speedtest , only on the button with a specific signature (in the html code), and if the extension supports, you can say to click only after a few seconds.

This would make your extension work, but it would only work on your computer, or on computers that have that extension enabled.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Technically this can be done using JScript, however this has to open the page in Internet Explorer, so the website has to load correct in IE.

 

https://blog.westmonroepartners.com/creating-user-interfaces-in-windows-scripting-host/

 

This does require some basic knowledge of HTML, CSS, & JavaScript, as you'll need to be able to identify the button in the DOM, but your situation is relatively simple, so it shouldn't be too difficult.

 

Assuming the page does load correctly in IE, this is probably the most reliable way to do it, but I know JScript can also be used to open programs and click on the screen as you want to do, but I don't have links to those resources.

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, JacobFW said:

Technically this can be done using JScript, however this has to open the page in Internet Explorer, so the website has to load correct in IE.

Why are you still using IE in this day and age? 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

There's a program called AutoIT which I've used myself to do click through dialog boxes in software. This was a machine that could not have any user interaction apart from hitting the power button. It's worked well for that.

Link to comment
Share on other sites

Link to post
Share on other sites

On 1/14/2020 at 11:00 PM, wasab said:

Why are you still using IE in this day and age? 

*sigh*

image.png.1ab48dada9d227923f3bdf31a5749db5.png

 

This can be done with IE.

Not, I use IE everyday, therefore opening myself up to well deserved ridicule.

 

This is however, one of the few practical uses IE still has left.

Microsoft didn't include this functionality in Edge, nor has any other browser included it in their browser, as today it's considered a security risk.

It's this functionality that's make it's fairly simple for many viruses to spread, as it provides fairly high level access for scripts running in browser.

Link to comment
Share on other sites

Link to post
Share on other sites

You can use selenium, a browser automation tool. You'll need to know Python to use it. Try Splinter.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×