Jump to content

Trying to find the ID of a TD tag that is parent to an image.


Recommended Posts

Background data:

I have a webpage that dynamically produces data, it places a check mark next to any of 4-6 options to indicate accuracy. I want to develop a way to target those options checked. The format is as follows:

Set1:

------Option1

------Option2

----\/Option3(checked)

------Option4

A total of 10 sets, and the check placement is random among the 4-6 options. The HTML relevant is as follows:

<td id="LID9_4"><img src="correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID9_4" name="Answer9" type="radio"><b>Option 4

I need to pair the 9 and the 4 from LID9_4 into a variable for later use. The format of the LID9_4 is Set9 Option4.

The thing I am having the most trouble with is locating that correct.gif and then pairing it with the LID9_4. I could develop an array for those if I could isolate them.

Edited by DoubleMcLovin
Link to comment
Share on other sites

Post the HTML for the whole item, and explain what you mean. What does "Set1" equate to in the HTML you posted?

Play with DOM. If you just need the other TD tags that are siblings of the one containing the .gif, it would be $oTD.nextElementSibling. You could also go to the parent and get the collection of all children (therefore all siblings of $oTD) with $oTD.parentElement.children.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Here is the HTML for everything

<div id="question_list"><form method="POST" name="quizform" action="/novella/QuizProcessingServlet"><input disabled="disabled" value="Multiple Choice" name="QuizName" type="hidden"><input disabled="disabled" value="no" name="UpdateableLink" type="hidden"><input disabled="disabled" value="The Athletic Trainer as a Health Care Provider" name="ChapterName" type="hidden"><input disabled="disabled" value="1" name="ChapterNumber" type="hidden"><input disabled="disabled" value="4426586" name="contentid" type="hidden"><input disabled="disabled" value="1" name="TypeOfQuiz" type="hidden"><input disabled="disabled" value="0073523739" name="isbn" type="hidden"><p></p><table border="0" cellpadding="0" cellspacing="0" width="100%"><input disabled="disabled" value="1" name="Question1" id="Question1" type="hidden"><input disabled="disabled" value="6" name="NoOfResponse1" id="NoOfResponse1" type="hidden"><tbody><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest1" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">1  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>Which of these individuals are the primary players in the sports medicine team?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_1" name="Answer1" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">athlete</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_2" name="Answer1" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">parent</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_3" name="Answer1" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">coach</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_4" name="Answer1" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">physician</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_5"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_5" name="Answer1" type="radio"><b>E)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">all of the above</td></tr><tr height="25px"><td colspan="2"></td><td id="LID1_6"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID1_6" name="Answer1" type="radio"><b>F)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">none of the above</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback1" colspan="5"></td></tr><input disabled="disabled" value="2" name="Question2" id="Question2" type="hidden"><input disabled="disabled" value="4" name="NoOfResponse2" id="NoOfResponse2" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest2" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">2  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>The __________ was formed to encourage and support scientific research in orthopaedic sports medicine and to develop methods for safer, more productive and enjoyable fitness programs and sports participation</td></tr><tr height="25px"><td colspan="2"></td><td id="LID2_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID2_1" name="Answer2" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">American Academy of Family Physicians</td></tr><tr height="25px"><td colspan="2"></td><td id="LID2_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID2_2" name="Answer2" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">National Athletic Trainers' Association</td></tr><tr height="25px"><td colspan="2"></td><td id="LID2_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID2_3" name="Answer2" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">American College of Sports Medicine</td></tr><tr height="25px"><td colspan="2"></td><td id="LID2_4"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID2_4" name="Answer2" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">American Orthopaedic Society for Sports Medicine</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback2" colspan="5"></td></tr><input disabled="disabled" value="3" name="Question3" id="Question3" type="hidden"><input disabled="disabled" value="4" name="NoOfResponse3" id="NoOfResponse3" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest3" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">3  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>In what year was the National Athletic Trainers' Association established?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID3_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID3_1" name="Answer3" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">1939</td></tr><tr height="25px"><td colspan="2"></td><td id="LID3_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID3_2" name="Answer3" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">1941</td></tr><tr height="25px"><td colspan="2"></td><td id="LID3_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID3_3" name="Answer3" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">1949</td></tr><tr height="25px"><td colspan="2"></td><td id="LID3_4"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID3_4" name="Answer3" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">1950</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback3" colspan="5"></td></tr><input disabled="disabled" value="4" name="Question4" id="Question4" type="hidden"><input disabled="disabled" value="4" name="NoOfResponse4" id="NoOfResponse4" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest4" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">4  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>The collection and development of pertinent information regarding desirable training methods, prevention and treatment of sports injuries, and utilization of sound safety measures is one of the primary responsibilities of the ___________.</td></tr><tr height="25px"><td colspan="2"></td><td id="LID4_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID4_1" name="Answer4" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">NSCA</td></tr><tr height="25px"><td colspan="2"></td><td id="LID4_2"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID4_2" name="Answer4" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">NCAA</td></tr><tr height="25px"><td colspan="2"></td><td id="LID4_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID4_3" name="Answer4" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">ACSM</td></tr><tr height="25px"><td colspan="2"></td><td id="LID4_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID4_4" name="Answer4" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">APTA</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback4" colspan="5"></td></tr><input disabled="disabled" value="5" name="Question5" id="Question5" type="hidden"><input disabled="disabled" value="6" name="NoOfResponse5" id="NoOfResponse5" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest5" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">5  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>What individuals compose the American College of Sports Medicine?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_1" name="Answer5" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">medical doctors</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_2" name="Answer5" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">doctors of philosophy</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_3" name="Answer5" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">athletic trainers</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_4" name="Answer5" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">physical educators</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_5"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_5" name="Answer5" type="radio"><b>E)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">all of the above</td></tr><tr height="25px"><td colspan="2"></td><td id="LID5_6"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID5_6" name="Answer5" type="radio"><b>F)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">none of the above</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback5" colspan="5"></td></tr><input disabled="disabled" value="6" name="Question6" id="Question6" type="hidden"><input disabled="disabled" value="8" name="NoOfResponse6" id="NoOfResponse6" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest6" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">6  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>Which of the following best describes the NATA?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_1" name="Answer6" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">an organization that enhances health care for athletes and physically active</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_2" name="Answer6" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">an organization that enhances health care for athletes only</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_3" name="Answer6" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">an organization that enhances health care for physically active individuals only</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_4" name="Answer6" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">an organization that advances profession through education</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_5"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_5" name="Answer6" type="radio"><b>E)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">an organization that advances profession through education and research</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_6"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_6" name="Answer6" type="radio"><b>F)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">c and d</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_7"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_7" name="Answer6" type="radio"><b>G)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">a and e</td></tr><tr height="25px"><td colspan="2"></td><td id="LID6_8"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID6_8" name="Answer6" type="radio"><b>H)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">b and e</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback6" colspan="5"></td></tr><input disabled="disabled" value="7" name="Question7" id="Question7" type="hidden"><input disabled="disabled" value="5" name="NoOfResponse7" id="NoOfResponse7" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest7" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">7  CORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>Which of these is the primary responsibility of an athletic trainer?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID7_1"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID7_1" name="Answer7" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">prevention of injuries</td></tr><tr height="25px"><td colspan="2"></td><td id="LID7_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID7_2" name="Answer7" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">recognition of injuries</td></tr><tr height="25px"><td colspan="2"></td><td id="LID7_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID7_3" name="Answer7" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">treatment and rehabilitation of injuries</td></tr><tr height="25px"><td colspan="2"></td><td id="LID7_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID7_4" name="Answer7" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">health care administration</td></tr><tr height="25px"><td colspan="2"></td><td id="LID7_5"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID7_5" name="Answer7" type="radio"><b>E)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">professional development and responsibility</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback7" colspan="5"></td></tr><input disabled="disabled" value="8" name="Question8" id="Question8" type="hidden"><input disabled="disabled" value="6" name="NoOfResponse8" id="NoOfResponse8" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest8" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">8  INCORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>What is the reason for licensure in athletic training?</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_1"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_1" name="Answer8" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">to limit the practice of athletic training to those that have met minimal requirements</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_2" name="Answer8" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">limits the settings in which athletic trainers can practice</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_3" name="Answer8" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">limits the number of individuals who can perform functions related to athletic training</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_4" name="Answer8" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">allows an athletic trainer to practice in areas outside their scope of expertise</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_5"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_5" name="Answer8" type="radio"><b>E)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">a and c</td></tr><tr height="25px"><td colspan="2"></td><td id="LID8_6"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID8_6" name="Answer8" type="radio"><b>F)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">b and d</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback8" colspan="5"></td></tr><input disabled="disabled" value="9" name="Question9" id="Question9" type="hidden"><input disabled="disabled" value="4" name="NoOfResponse9" id="NoOfResponse9" type="hidden"><tr><td colspan="5" bgcolor="#cccccc"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="1"></td></tr><tr height="35px"><td id="quest9" style="text-align: left; font-size: 14px; font-weight: bold; color: rgb(255, 255, 255); width: 130px;" colspan="2" bgcolor="#cccccc" valign="top" width="2%">9  CORRECT</td><td><img src="/olcweb/styles/shared/spacer.gif" height="1" width="5"></td><td colspan="2" valign="top"><img src="/olcweb/styles/shared/spacer.gif" height="5" width="1"><br>The accreditation process associated with athletic training education focuses its attention primarily to ____________ .</td></tr><tr height="25px"><td colspan="2"></td><td id="LID9_1"><img src="/olcweb/styles/v2_glencoe/images/correct.gif"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID9_1" name="Answer9" type="radio"><b>A)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">the quality of experiences and student outcomes and knowledge</td></tr><tr height="25px"><td colspan="2"></td><td id="LID9_2"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID9_2" name="Answer9" type="radio"><b>B)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">the volume of hours accrued by students during their educational process</td></tr><tr height="25px"><td colspan="2"></td><td id="LID9_3"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID9_3" name="Answer9" type="radio"><b>C)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">the volume of athletes seen by staff athletic trainers on a daily basis in the clinical setting</td></tr><tr height="25px"><td colspan="2"></td><td id="LID9_4"><img src="/olcweb/styles/shared/spacer.gif" height="1" width="40"></td><td style="text-align: right;" valign="top"><nobr><input disabled="disabled" value="LID9_4" name="Answer9" type="radio"><b>D)</b><img src="/olcweb/styles/shared/spacer.gif" height="1" width="10"></nobr></td><td width="100%">the athletic training faculty's ability in the classroom to instruct students</td></tr><tr><td></td></tr><tr><td style="text-align: left; width: 100%; font-weight: bold; min-height: 20px; padding-left: 100px;" id="feedback9" colspan="5"></td></tr></tbody></table><div id="grade_quiz_button" align="right"></div><iframe hspace="0" vspace="0" src="/olcweb/styles/v2_glencoe/shared/logQuizSubmission.html" id="logQuizSubmission" name="logQuizSubmission" scrolling="no" frameborder="0" height="0" width="0"></iframe></form></div></div><table id="email_form" style="display: block; clear: both;" border="0" cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td colspan="4" align="left" valign="middle"><form action="/novella/ClientSideResultsMailingServlet" method="post" name="frmMail"><input value="no" name="UpdateableLink" type="hidden"><input value="4426586" name="contentid" type="hidden"><input value="1" name="TypeOfQuiz" type="hidden">

I can navigate through the sets myself fairly easily. That is just there to tell you that there will be more than one set of answers with a correct.gif image. I plan on navigating through sequential sets using a FOR...IN...NEXT loop.

The easiest way I think this could be achieved is to locate the image (easy enough) and then discover the parent TD tag ID. How could this be coded?

Link to comment
Share on other sites

Why can't you just get all the <td>s and then use _ArraySearch() or _ArrayFindAll() to find out which one(s) contain the image you want to search for?

$aTD = StringRegExp($sHTML, "(?i)(?s)(<td.+?/td>)", 3)

Edit: If you tell us exactly what you want returned out of that HTML then we can probably do better.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

So you want the ID string from the parent TD tag that holds the matching IMG tag.

1. Get the collection of all IMG tags with _IEImageGetCollection()

2. Walk through the collection with a For/In/Next loop

3. Check if IMG source matches search parameter for each IMG tag

4. If it matches, use $oIMG.parentElement.id to get the parent TD tag's ID

5. Collect results in an array as desired

This example shows getting the collection and the parent IDs:

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com/forum/")
$colIMG = _IEImgGetCollection($oIE)
For $oIMG in $colIMG
    ConsoleWrite("IMG source = " & $oIMG.src & "; Parent ID = " & $oIMG.parentElement.id & @LF)
Next

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

So you want the ID string from the parent TD tag that holds the matching IMG tag.

1. Get the collection of all IMG tags with _IEImageGetCollection()

2. Walk through the collection with a For/In/Next loop

3. Check if IMG source matches search parameter for each IMG tag

4. If it matches, use $oIMG.parentElement.id to get the parent TD tag's ID

5. Collect results in an array as desired

This example shows getting the collection and the parent IDs:

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com/forum/")
$colIMG = _IEImgGetCollection($oIE)
For $oIMG in $colIMG
    ConsoleWrite("IMG source = " & $oIMG.src & "; Parent ID = " & $oIMG.parentElement.id & @LF)
Next

;)

Thank you, this seems like it will do exactly what I need! I will try it out when I get some free time in the next couple days and let you know if I have any trouble, though this seems like exactly what I needed. Is there a place where I can find all the possible options for the _IEImgGetCollection($xx) [eg:$oIMG.parentElement.id]
Link to comment
Share on other sites

You have to climb the learning curve just like the rest of us. Do you understand what and OBJECT and a COLLECTION are? That's where you start, then you can dig into the Document Object Model (DOM) of IE for the particular methods and properties of each element.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...