S
swin
I've a wrapper class around axBrowser which logs into a site,
navigates to a data page and harvests info from it.
It works fine for a single data page (passing it a key for the data),
but my next task is to put it in a loop so that I can retrieve
multiple pages of data.
My problem is that how can I control the loop such that it won't try
and get the next page of data until the previous one has completed -
bearing in mind that I have to wait until the axBrowser has signalled
that its done the download by firing the DownloadComplete event.
I think the logic would be something like this but I'm not sure how to
code this in C#:
1. Create new browser wrapper object (bwo).
2. Get a list of keys for the bwo to harvest data for.
3. Start loop of all keys.
4. Call Navigate2 in bwo to navigate to the correct data page using
the current key.
5. Wait until bwo has signalled that its fired DownloadComplete and
got the data and has returned ok.
6. Jump back to 3 until all keys have been read.
Browser wrapper has the following standard axBrowser methods:
Navigate2 - to go to the desired data page.
DownloadComplete - called when the data page is downloaded - could be
any length of time after Navigate2 called. Fires an event to signal
that we've done this page.
I've an inkling that I'll need to use threading, but I'm not sure how
to go about it and also that the axBroswer in single threaded which
may make it more interesting?
Thanks in advance for any help
Swin
navigates to a data page and harvests info from it.
It works fine for a single data page (passing it a key for the data),
but my next task is to put it in a loop so that I can retrieve
multiple pages of data.
My problem is that how can I control the loop such that it won't try
and get the next page of data until the previous one has completed -
bearing in mind that I have to wait until the axBrowser has signalled
that its done the download by firing the DownloadComplete event.
I think the logic would be something like this but I'm not sure how to
code this in C#:
1. Create new browser wrapper object (bwo).
2. Get a list of keys for the bwo to harvest data for.
3. Start loop of all keys.
4. Call Navigate2 in bwo to navigate to the correct data page using
the current key.
5. Wait until bwo has signalled that its fired DownloadComplete and
got the data and has returned ok.
6. Jump back to 3 until all keys have been read.
Browser wrapper has the following standard axBrowser methods:
Navigate2 - to go to the desired data page.
DownloadComplete - called when the data page is downloaded - could be
any length of time after Navigate2 called. Fires an event to signal
that we've done this page.
I've an inkling that I'll need to use threading, but I'm not sure how
to go about it and also that the axBroswer in single threaded which
may make it more interesting?
Thanks in advance for any help
Swin