Hi-

I need to create a program, or maybe a script of some sort, or even a browser extension possibly. I'm not sure... need some direction.

Once logged into a webpage, I'll do this manually, I need to--

auto refresh the page every XX amount of seconds

Detect a change in the page, specifically I'm looking for a check box, but detecting ANY change in the page will work.... whatevers easiest.

I then need to auto select the page so that I can TAB. I do this manually by hitting the mouse button anywhere on the page.

I then need to auto TAB X amount of times to highlight the check box

I then need to auto select text box. Manuall I can do this with the space bar

Then it's more tabing and the enter button on the keyboard (to select a web button as you would with a mouse pointer.

Where do i start? Is there more than one way? Any direction is greatly appreciated. Seems so simple.... to be able to run keyboard strokes on a web page without using the keyboard. I can see it might get a little complicated with auto detecting changes etc....

That first part (checking to see if a box is checked or not without any client side script) is a bit "impossible," assuming this is meant to affect some sort of data exchange. You would need javascript to do this (or any other of the very few client side scripting languages, which is supported by the browser in question).

Based on what it sounds like you are doing, it would probably be much easier to see what parameters are being passed from the form you are submitting, and simply copy/paste the URL with the parameters set.

If it is a POST statement, you can probably easily write a script to spoof a post to the page, and voila happy day.

You are thinking in terms of a graphic interface for what essentially comes down to an HTTP request, which is basically a string.

At least, that's my take on it...

Thanks for your help.

To clarify, I don't need to know if the box is checked. I know it will be unchecked.

I will need to check it, hit a web page button (essentially a hyperlink) that takes me to the next page, where I'll need to hit another page button (again, a hyperlink).

What I will need to detect is if the page I'm refreshing changes in any way (could be detection of additional text, a hyperlink, etc) as this will be the notifier to run the string of commands (if the page changes it will only change to one thing, every time).

I hope I'm making sense here....

Perhaps if you explained your goal, it might be a little easier to help.

Now, I understand that you want a checkbox selection, or any change of a page, to trigger a series of events.

The question is, why? Do you want this to be autonomous? Are you doing the clicking or anyone? Is this for anyone to see or just you?

Odds are you will have to run an AJAX query of some sort, that will check for a statechange of the checkbox button via javascript, then send information to your target page.

Without more info, it's really difficult to help you.

//my javascript is broken. Dont use this yet...

you can feel free to ignore the above, I re-read your post and I fear my eyes are a bit tired.

So, you click your check box and send off to another page that the box has been checked. Sounds like a simple form with a check box, or an anchor that uses javascript as the action.

example:

Code snipped, fixed code is below

The above should work. Change the URL you are redirecting to, and then do what you need. However, doing all the other keyboard functions are also not necessary. You are asking to go to a URL. Simply go to the URL, and pass parameters (all the fun stuff after the &)

Wow... This is awesome....I'm starting to get it a bit. Thanks for this.

1st thing....

This is going to sound real dumb. What do I do with the above code?

If this helps any I am auto refreshing a page every second to find new orders, which I want to auto accept. I'm looking at the code above and it looks like something I'd place in a web design page.

These orders are broadcast in the middle of the night, and they go quickly due to others using the same type of tactics.

It's password protected otherwise I'd just give you the info.

sigh sorry about the code above. If I could delete it, I would.. the fixed code is below:

<html>
<head>
<title>Test</title>
<head>
<script type='text/javascript'>

var url='http://www.ryantroop.com';
var checked=false;


function checkBox() {

if(document.getElementById("myCheckBox").checked) {
checked = true;
}else {
checked = false;
}

}

function getURL() {

checkBox();
if (checked) {
url += '?checked=true';
window.open(url);
}
else
{
window.open(url);

}

}
</script>
</head>
<body>

<form>

<input id='myCheckBox' type="checkbox" name="vehicle" value="Bike">I have a bike<br>

</form>

<a href='javascript:getURL()'>Click here!</a>

</body>
</html>

Anyway... to your particular problem... There are a few ways to do what you want... Im not sure why checking a checkbox is necessary, but since it is.. it all works the same... you are making a URL and passing it to a server with information. The check box is arbitrary. If you want to automate the process, you would need to do some research into what parameters are being passed, and to what location. Also, if this is dealing with money, they probably have scripts in place to prevent automation (such as repeat/fast subsequent requests from the same IP address). If you are running a script very quickly, their server may even view it as an attempted DDOS attack and shut down all traffic from you - especially if money is involved.

So.. think clearly about what you want to do.

Hey, don't worry about it.... I relly appreciate all your help.

The check box is there because the 'new orders' page will sometimes display more than one order, in line item format. If you only want to accept, say, two out of four you check the boxes of the two you want, then proceed to click the next button.

I do this manually right now, and if you refresh more than 2x in one second it will warn you to slow down.

When you say research parameters and locations am I correct to assume you mean what info is being sent to what location on the web?

I beleive it is just a matter of what URLs are being used in each step, which I can log no problem.

Yes, but you need to be able to read what the parameter is from the check box if it is different each time.

So, you may have to get a bit more involved and build a scraper, find what you want to from there, then send the URL as needed.

I had assumed it was the same each time.

You could find the params, write a simple script using Python on your friendly language of choice, scrape the info you want, and plop it into a URL that opens the page for you. That way you can even set up an array with strings that have items similar to what you are looking for.

Otherwise, if it's the same variable passed each time, and the same information being passed, then you can automate it by simply logging the params and sending them through script over and over as necessary.

OK... I downloaded Python, and, no way am I knowledgeable enough to write raw code. If it isn't copy and paste forget it. Lol.

I see you have inserted your contact info in the above code. You interested in putting this together?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.