I decided to refactor one of my projects using the CEF, I can’t do one thing, could you direct me on the right path.
This program is an automated bot (information collector). The site has many frames.
How it worked before changing the code with a standard Webbrowser.
- Code: Select all
private void goHotel()
{
HtmlElementCollection frame_tag;
frame_tag = webBrowserHunt.Document.GetElementsByTagName("iframe");
foreach (HtmlElement he in frame_tag)
{
if (he.Name.Contains("header"))
{
HtmlWindow doc = he.Document.Window.Frames[he.Name];
HtmlElementCollection a_tag = doc.Document.GetElementsByTagName("a");
foreach (HtmlElement hEl in a_tag)
{
if (hEl.OuterHtml.Contains("Hotel"))
{
hEl.InvokeMember("click");
break;
}
}
break;
}
}
}
The method found I need a frame, in this case (header)
Then in this frame I found the link I needed (element <a> of the "Hotel") and performed the click method.
- Code: Select all
<a class="menutop" onclick="this.blur(); jumptopath('/main.pl?edit='); return false;" href="#">Hotel</a>
I can’t figure out how to use the CEF to find me this element and click on it.
Thank you very much in advance.