2024-01-06, 16:04:08
I am trying to locate an element based on a given tag, attribute and value. What's the best way to do this using VB6? Is this Possible? Thanks
Code:
tag = "span";
attr = "innerhtml";
value = "^" + project.Variables["facebookPageName"].Value.Replace(" ","\\ ");
searchType = "regexp";
findStr = "input:radio"
// Find Correct Page Element
HtmlElementCollection results = instance.ActiveTab.FindElementsByAttribute(tag, attr, value, searchType);
foreach (HtmlElement res in results)
{
if (res.ParentElement.PreviousSibling.FirstChild.FirstChild.GetAttribute("fullTag") == findStr )
{
project.SendInfoToLog("Element Found " + res.InnerText);
}
}