I'm fairly new to PowerShell scripting and want to create a script that performs a speed test using speedtest.net and displays the download speed in the command line. Here's what I've attempted so far:
I've set a URL for the speed test site and am trying to utilize Invoke-WebRequest to grab the web page. My aim is to find the "start-text" class to click and initiate the test. Despite seeing the method to click when I run a Get-Member command, I'm facing an issue that says there's no method named 'click' for the object. Can anyone help with this? Are there better methods to accomplish this?
3 Answers
If you're still interested in coding it out, here's a script that automatically handles downloading the CLI and sends results via email after running the speed test. This can be really handy if you're monitoring speeds across different endpoints.
Honestly, your approach seems pretty complicated for what you want to achieve. The webpage likely relies on JavaScript for the speed test functionality, which adds complexity to your script. Instead, just use the CLI they provide, it's much simpler and effective!
You might want to check out the Speedtest CLI tool instead! It can be downloaded from speedtest.net/apps/cli, and it offers multiple output formats like JSON and CSV, making parsing the results in your script a breeze.
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String