Skip to main content
GameDev.net gamedev.net
🔒 Locked

Automate checking boxes in a web page using a script

Started by pizza box Sep 26, 2007 at 9:51 AM 3 replies 1.2k views
Original Post
pizza box
pizza box
Although this isn't exactly related to games, I was just curious if this was possible with scripting as it would save me a lot of time. I have a webpage that acts as an interface for another application. One part of using this webpage involves clicking on many checkboxes and then deleting the selected items. Unfortunately, there is no "Check all" box that would enable me to select all of the items (there can be up to a thousand or so). So each day I have to spend up to 45 minutes clicking each individual checkbox and deleting the objects. Would it be possible to create a script (I've been using VBScript for other stuff) that would simulate a user checking all of the boxes on a given page? Maybe I could cycle through all of the objects in a page and find any checkboxes, then change a property from unchecked to checked. I tried searching for this for a while but I never got too far. I found stuff such as OLE and DDE but I wasn't sure if this would be useful. Any input would be greatly appreciated!
drakostar
drakostar
First, learn the basics of HTTP. Then fire up something like Python/urllib.

Or...download something like EZMacros, and use the right number of tab and spacebar presses to check all the boxes.
Kylotan
Kylotan
Or something like GreaseMonkey for Firefox would allow you to write a page-specific &#106avascript script to check the boxes.
drakostar
drakostar
I forgot about Greasemonkey. Yeah, that's probably the best option, should actually only take a few lines of code.
pizza box
pizza box
Thanks a lot for the replies, this has pointed me in the right direction.

Thanks again!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.