How to get pixel information from a webbrowser ?

B

Boki

Hi All,

I am programming a message robot to Yahoo somewhere.

I found it is impossible to leave a message directly.

because

1. There are 2 security keys need to fit, the key only come with the
web page when user already request it ( I means if we didn't request
that web page first, we can't get the key )

2. Even we can get the key by simple request that web page ( key is
dynamic change by every single load/reload ), we still can't know what
string/code be exactly sent to Yahoo when we click 'submit' button.
Even I try to use Navigating method, it is failed. ( ya, of course, I
can get a target URL, but if we navigate to target URL directly by our
code, it will fail, unless we go there by click the physical button of
web page ( in fact, I can't understand this, I am not web language
guy )

3. I am trying to use send {"TAB~"} keys directly, originally, I think
it should work, but the fact is - yahoo will also dynamic change their
advertising - sometimes it shows up, sometimes it doesn't. So, the
constant number for {"TAB~"} can't work.

4. This is my final method ==> image processing. I will find the exact
button location on webbrowerser and then send the mouse cursor there
to just do a perfect click.


I recall the VB6 processing, we can use API to get pixel of a form or
picutrebox, but could you please advice how to do that from a
webbrowser ? also, I have no idea how to start this part of code in C#
yet.

Appreciate for your advice!
Best regards,
Boki.



Best regards,
Boki.
 
M

Marc Gravell

1: this is possibly against the target sites usage policy, so I
wouldn't be shocked to find deliberate stumbling blocks
2: shouldn't you be looking at the DOM? Instead of messing with pixels
/ tabs, can't you find the submit botton and simply invoke it?

Something like browser.Document.GetElementById(...),
browser.Document.Body.All.GetElementsByName(...) or
browser.Document.Body.GetElementsByTagName(...), and finally
..InvokeMember("Click")?

Marc
 
B

Boki

1: this is possibly against the target sites usage policy, so I
wouldn't be shocked to find deliberate stumbling blocks
2: shouldn't you be looking at the DOM? Instead of messing with pixels
/ tabs, can't you find the submit botton and simply invoke it?

Something like browser.Document.GetElementById(...),
browser.Document.Body.All.GetElementsByName(...) or
browser.Document.Body.GetElementsByTagName(...), and finally
.InvokeMember("Click")?

Marc

You are right, I should try the Invoke click something. ( In fact, I
don't know this before )

Speaking to the finding image, I think it is doable, due to the image
of button is fixed pattern.

Thanks!
Boki.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top