Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

IE Automation - search source code for string

Avatar of paulpp
paulppFlag for United States of America asked on
Microsoft ExcelVisual Basic.NET
6 Comments1 Solution294 ViewsLast Modified:
Hello,

I am trying to do a test whether a string on a webpage.  The problem is the text is encoded into a javascript function, so I cant do GetElementsBy....  Below is the source code I am looking at (I just attached the script the string is in), and a snipet of the line containg the string i need ("Parts not found !!".  Thank you.
str = str + "  <td class=\"LT_dataR\"><font color=red>Parts not found !!</font><a href='javascript:beforeOpenAlter(0);' onbeforeactivate='JAVASCRIPT:ignoreChange(true);'><img src='/gspn/images/en/Icon_search.gif' border=0 hspace=2 align='absmiddle'></a></td>";
      str = str + "</tr>";
function displayListData(){
    var str = "   <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"LT_deco\" id="+tid+">";
      str = str + "    <tr>";
      str = str + "     <td width=\"5%\" class=\"LT_head\"><input type=checkbox name=chk_all onClick=checkAll();></td>";
      str = str + "     <td width=\"12%\" class=\"LT_head\">Parts No <font color=#FF6600>*</font></td>";
      str = str + "     <td width=\"7%\" class=\"LT_head\">Qty <font color=#FF6600>*</font></td>";
 
      str = str + "     <td width=\"12%\" class=\"LT_head\">Shipping Method <font color=#FF6600>*</font></td>";
 
      str = str + "     <td width=\"12%\" class=\"LT_head\">Narda/Ticket No</td>";
 
      str = str + "     <td width=\"11%\" class=\"LT_head\">Service Date</td>";
      str = str + "     <td width=\"12%\" class=\"LT_head\">Reason</td>";
 
      str = str + "     <td class=\"LT_headR\">Result</td>";
      str = str + "    </tr>";
 
      str = str + "<tr>";
      str = str + "  <td align=center class=\"LT_data\"><input type=\"checkbox\" name=\"chk\"></td>";
 
      str = str + "  <td class=\"LT_data\"><input name=\"material\" type=\"text\" class=\"Fdefaultp\" size=20 maxlength=18 value=\"TEST\" onKeyUp=\"checkPartNo(this, "+0+")\" onChange=\"onChangePart(this)\"><a href=\"javascript:beforeOpen("+0+");\" onbeforeactivate=\"JAVASCRIPT:ignoreChange(true);\"><img src=\"/gspn/images/en/Icon_search.gif\" border=\"0\" hspace=\"2\" align=\"absmiddle\"></a></td>";
      str = str + "  <td class=\"LT_data\"><input name=\"quantity\" type=\"text\" class=\"F100p\" maxlength=6  style=\"text-align:right;\" value=\"14\" onChange=\"checknum(this);\"></td>";
 
 
 
 
      //str = str + "<td class=\"LT_data\"><input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"S\" >Standard";
      //str = str + "<input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"E\" >Expedited";
	  //str = str + "<input name=\"ship_method0\" type=\"radio\" class=\"FDefault\" value=\"N\" >No Cool</td><input type=hidden name=ship_method value=\"D1\">";
      str = str + "<td class=\"LT_data\"><select name=\"ship_method\" class=\"F70p\" style=\"width:100%\">";
                str = str + "<option value=\"\"></option>";
 
                str = str + "<option value=\"D8\" >Next Day</option>";
 
                str = str + "<option value=\"T1\" >2ND Day</option>";
 
                str = str + "<option value=\"D1\"  selected >Ground</option>";
 
                str = str + "</select></td>";
 
      str = str + "  <td class=\"LT_data\"><input name=\"refno\" type=\"text\" class=\"F100\" maxlength=10 value=\"\" ></td>";
 
      str = str + "  <td class=\"LT_data\"><input name=\"service_date\" value=\"\" type=\"text\" class=\"Fdefault\" style=\"text-align:left;ime-mode:disabled\" size=8 maxlength=10 onkeydown=\"checkDateFormat(this, window.event.keyCode,'down','MM/dd/yyyy')\" onkeyup=\"checkDateFormat(this, window.event.keyCode,'up','MM/dd/yyyy')\"><img src=\"/gspn/images/en/Icon_cal.gif\" hspace=\"2\" border=\"0\" align=\"absmiddle\" onclick=\"javascript:beforeOpenCalendar('FORM_ORDER.service_date', "+0+");\" style=\"cursor:hand;\"></td>";
      str = str + "  <td class=\"LT_data\"><input name=\"reason\" type=\"text\" class=\"F100\" maxlength=50 value=\"\" ></td>";
 
      str = str + "  <td class=\"LT_dataR\"><font color=red>Parts not found !!</font><a href='javascript:beforeOpenAlter(0);' onbeforeactivate='JAVASCRIPT:ignoreChange(true);'><img src='/gspn/images/en/Icon_search.gif' border=0 hspace=2 align='absmiddle'></a></td>";
      str = str + "</tr>";
 
      str = str + "</table>";
 
    document.all.sortDIV.innerHTML = str;
  }