Alright to star off let me say sorry for my english typos. This question is not for a homework and in no way related to school. Im in 3d conception. But looking to get a program for personal use.

I have a project i want to work on and need help since im crossing over in a feld i dont know that much. In have programmed code in the past nothing to hard:

I want to build a program that will scan a webpage. In a defined area. And look for a img or text for "checking" if it find this img or text on the screen i want it to check for a sub img or text lets say "destluck" then ill need it to count down from 5sec to 1sec. Then if it reaches 5 sec i want to to left click a certain location on the page.
Programmed in c++ if possible

Lets sum it up this aint the real info:
Webpage: www.rx8club.com
Img1: Vendor forums once u found it
Check for img2: vendorclassifiedS
If both are found count up to 5sec
If so left click certain area


I dont mind hard work and getting dirty just need to know links on where to find the info for this...

You would first have to know how to use bitmaps quite well and take screenshots in C++.

You'd then get the raw code of the bitmap and compare it with the image on screen. This might require you to know how to do arrays really well too. Since your going to have to compare the RGB colours of the bitmaps which is stored in arrays.

You would also have to have a tolerance on the image/colours because the recognition would definitely NOT be exactly the same pixels.

http://www.codeproject.com/KB/graphics/BitmapCompare.aspx

The website is always changing but the img i need to find on it is always the same does that change something? I just need it to scan a live webpage and find the img im asking on it.
Can it be done?

I was figuring i could take a bitmap of the "checking" img and then ask the program to locate that img in a defined area on the screen?

There's still the possibility of needing a fuzzy-match. There is no guarantee that your browser's renderer displays the source image pixel-by-pixel perfectly each time.

If it did, it would be sufficient to do something like:

int checkImgI = -1, checkImgJ = -1;
for (int i = 0; i < screenHeight - checkImgHeight; i++)
    for (int j = 0;  j < screenWidth - checkImgWidth; j++)
        if (ImageStartsAt(checkImg, i, j)) {
            checkImgI = i;
            checkImgJ = j;
            break;
        }

where ImageStartsAt() then iterates over each pixel in checkImg and checks whether the underlying pixel in the screen is the same.

If the pixels aren't necessarily equal, you'll need to modify ImageStartsAt() to return some kind of "difference" metric, and assume if you find a sufficiently small difference, then you've probably found some version of the image.

If the browser is allowed to scale the image, based on some kind of user preference and the way the embedding web-page is written (such as on the iPhone, for example, where you can interactively zoom a web-page), you're going to have increasingly bigger problems.

Good luck!

ok posting a link to a pic maybe this will make it more clear

Lets say my name is "Serge800"
and the red box is the timer.
is there a way to keep track of the timer?

[IMG]http://img853.imageshack.us/img853/3103/imgvc.png[/IMG]

Then once the Timer hits 0 it looks like this:

[IMG]http://img841.imageshack.us/img841/9296/img1u.png[/IMG]

once i reach this stage i need to find a way to count 5sec then click where ill tell it too.

Can it be done if anyone is interested in helping me feel free to add me on msn messenger dark_viper26@hotmail.com
i just need to know a easy way to keep track of a name and a time on a website.

Yes it can be done. No, it probably isn't worth the effort to do image-based character recognition. You'd be better off trying to scrape the source of the web-page and find the current value of the timer display string in it. It would be more computationally efficient, and less error-prone. Also, instead of then clicking on something in the web page, you could just generate the same HTTP POST request back to the server that would be generated by performing the click.

hmm u willing to add me to msn so we can talk this step over a bit? would really apreciate it.

Edited 5 Years Ago by Destluck: n/a

Lets say i do use a program to Website scrape what do i do with the info next. sorry first time programming this type of program but i cant turn back so i must start it and finish it.

Take a look at libcurl. There are probably other options as well, but this one is well understood by enough people that you can probably get input from multiple sources here.

The basic premise is to write a program which, as far as the website is concerned, acts like a browser: make a request for the contents of the web-page, go back and ask for any resources you need (e.g. included javascript sources), and so on until you have all the information you need. Somewhere in there you'll be able to determine what is being sent back to the server when the user clicks whatever you're interested in, and you can send that same message yourself. You can also present the same (or similar) browser view to your user, if that's relevant, using a GUI toolkit of your choice (including something as advanced as Qt Webkit, which provides full web-browser fucntionality) or you can automate the entire process if all you want to do is simulate having a user click on something, but don't actually need to involve your user at all.

Since you would presumably be doing something other than image-processing / character-recognition, consider ending this thread and starting a new one with your own code once you've got something started.

This article has been dead for over six months. Start a new discussion instead.