Friends I have to do a test to validate the text inside an element that I am not able to map. I've tried everything!! The element is a tooltip
I did the mapping by xpath but it's horrible!!!
I need to validate all the text of the tooltips of each element of the cell in the status column. Is there an easier way to do this and map the element without using xpath
[![element :txt_tooltip, :xpath, '/html/body/div\[2\]/div/div\[2\]/table/tbody/tr\[3\]/td\[1\]/div/div\[2\]/div\[1\]/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr\[2\]/td\[2\]/table/tbody/tr\[2\]/td/table/tbody/tr\[2\]/td/table/tbody/tr/td/div/div\[2\]/div/div/div/table/tbody/tr\[3\]/td\[6\]/img'
get_text_tooltip = txt_tooltip.text
expect(get_text_tooltip).eq ('Somente Leitura')
-Formatted HTML-
<a name="TVXWFMTGINSTATOCE"></a>
<div class="tvCaption">
<div style="display:inline-block;width:100%">
<img src="r/std/static/pixel.gif" class="icon Enabled icon_grid" draggable="false" onclick="sendEvent(0,event,this,true,0,'','1bfd','ControlMenu#','','','','','');"><img src="r/std/static/pixel.gif" class="icon Enabled icon_norows" draggable="false" onclick="sendEvent(0,event,this,searchImage(this),0,'','1bfd','SelectNone#','','','','','');" alt="Selecionar Nenhum" tooltip="Selecionar Nenhum"><img src="r/std/static/pixel.gif" class="icon Enabled icon_allrows" draggable="false" onclick="sendEvent(0,event,this,searchImage(this),0,'','1bfd','SelectAll#','','','','','');" alt="Selecionar todos" tooltip="Selecionar todos"> Lista campos
<div onclick="if(notSelecting()) sendEvent(0,event,this,searchImage(this),0,'','1bfd','TMMenu#','','','','','');" style="white-space: nowrap;" class="tvMsg tvMsgEna"><img src="r/std/icons/menu64.png" class="icon" draggable="false"></div>
<div onclick="if(notSelecting()) sendEvent(0,event,this,searchImage(this),0,'','1bfd','CambioLabel#','','','','','');" class="tvMsg tvMsgEna" style="white-space: nowrap;" tooltip="Editar Label">
<img src="r/std/static/label16.gif" class="icon" draggable="false">
<div class="tvCaptionSep"></div>
</div>
</div>
</div>
<div>
<div style="" class="tvContent">
<div style="display:table;width:100%; background:inherit;">
<div style="display:table-cell;">
<table class="tvGrid" width="100%">
<tbody>
<tr>
<th colspan="1" class="tvHeader">Nome</th>
<th colspan="1" class="tvHeader">Etiqueta</th>
<th colspan="1" class="tvHeader">Tipo Dado</th>
<th colspan="1" class="tvHeader">Valores </th>
<th colspan="1" class="tvHeader" width="1">Preenchimento automático</th>
<th colspan="1" class="tvHeader">Status </th>
<th colspan="1"></th>
</tr>
<tr oncontextmenu="if(!this.cancelEvent) {sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','1bfd','BtnDropDownRow#',0,'','','');return false;} delete this.cancelEvent;" onclick="if(notSelecting()) sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','1bfd','Select#',0,'','','');" onmousedown="if(event.ctrlKey) this.cancelEvent=true;" class="tvRow tvRowOdd tvRoll" style="cursor:pointer;">
<td class="tvCell" valign="center" align="left">FLAG_INSERIMENTO_LETTURA_E</td>
<td class="tvCell" valign="center" align="left"> Leitura Existente</td>
<td class="tvCell" valign="center" nowrap="" align="left"></td>
<td class="tvCell" valign="center" align="left"></td>
<td class="tvCell" tooltip="" width="1" valign="center" align="left"></td>
<td class="tvCell" valign="center" align="center"><img tooltip="Facultativo" src="r/std/static/ok16.gif"></td>
<td style="line-height:1px;padding:0px;" class="tvCell" width="30" valign="center" align="center">
<div onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','1bfd','BtnDropDownRow#',0,'','','','');" class="but">
<div><img src="r/std/icons/menu64.png" class="icon" draggable="false" align="absmiddle"></div>
</div>
</td>
</tr>
<tr oncontextmenu="if(!this.cancelEvent) {sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','1bfd','BtnDropDownRow#',1,'','','');return false;} delete this.cancelEvent;" onclick="if(notSelecting()) sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','1bfd','Select#',1,'','','');" onmousedown="if(event.ctrlKey) this.cancelEvent=true;" class="tvRow tvRowEven tvRoll tvRowSelected" style="cursor:pointer;">
<td class="tvCell" valign="center" align="left">XWFMSLETMATRICOLA_E</td>
<td class="tvCell" valign="center" align="left"> Nº Hidrômetro</td>
<td class="tvCell" valign="center" nowrap="" align="left"></td>
<td class="tvCell" valign="center" align="left"></td>
<td class="tvCell" tooltip="[AIMPMATRICOLA]" width="1" valign="center" align="left">
<button onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','1bfd','AUTOFILLBTN#',1,'','','','');" class="but butAct" tabindex="0" tooltip="Preenchimento automático ativado" type="BUTTON">
<div><img src="r/std/icons/checkboxselected64.png" class="icon" draggable="false" align="absmiddle"></div>
</button>
</td>
<td class="tvCell" valign="center" align="center"><img tooltip="Somente Leitura" src="r/std/static/lock16.gif"></td>
<td style="line-height:1px;padding:0px;" class="tvCell" width="30" valign="center" align="center">
<div onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','1bfd','BtnDropDownRow#',1,'','','','');" class="but">
<div><img src="r/std/icons/menu64.png" class="icon" draggable="false" align="absmiddle"></div>
</div>
</td>
</tr>
You keep asking the same type of question, and don't appear to be learning anything from the answers. You really need to just go study CSS selectors and learn them - try https://flukeout.github.io/ and work on it until you understand all the selector types.
In this case the code you've shown can't be working alone because you're getting text when the value you need is actually in the tooltip attribute of the element. So either your code doesn't work, or you're moving the mouse first and the HTML is changing to something that shows that attribute as the text content of an element.
to use CSS and get the tooltip value of all the elements you could do something like
all('tr.tvRow .tvCell:nth-child(6) img[tooltip]').map { |el| el['tooltip'] }
which would return an array of the tooltip attribute values of the elements. Technically you could probably drop the 'tr.tvRow' from the beginning of that and it would still work but better safe than sorry. You could use that CSS in a SitePrism 'elements' statement, but until you really understand CSS selectors SitePrism is really just adding more confusion to things.
Here is the html I am trying to scrape using Xpath:
<table class="ClassGrid" cellspacing="0" cellpadding="0" border="0" id="_ctl0_phMainContent_dgrdClasses" style="border-collapse:collapse;">
<tbody>
<tr>
<td class="ClassGridRow1" colspan="3">
<hr>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1">Address 123
<br>
<br><a target="_blank" class="gridDirections" href="/Classes/Directions.aspx#104">Directions</a></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">12/12/2018</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl3_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4233&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">1/24/2019</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl4_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4306&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, August 4</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBoxNone"></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, August 18</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl6_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4346&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Thursday, August 30</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl7_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4313&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, September 8</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl8_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4330&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Tuesday, September 18</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl9_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4331&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1" colspan="3">
<hr>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1">Address 0000
<br><a target="_blank" class="gridDirections" href="/Classes/Directions.aspx#190">Directions</a></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, July 21</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl11_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4242&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Tuesday, August 28</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl12_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4243&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Tuesday, September 25</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl13_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4271&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1" colspan="3">
<hr>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1">Address 456
<br><a target="_blank" class="gridDirections" href="/Classes/Directions.aspx#69">Directions</a></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Wednesday, August 1</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl15_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4276&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, August 25</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl16_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4277&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Thursday, September 13</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl17_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4348&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, October 6</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl18_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4278&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Wednesday, October 31</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl19_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4279&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, November 17</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl20_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4280&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1" colspan="3">
<hr>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1">Address 789
<br><a target="_blank" class="gridDirections" href="/Classes/Directions.aspx#223">Directions</a></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, August 4</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl22_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4347&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Saturday, August 18</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl23_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4305&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1">
<div class="ClassGridBox1"></div>
</td>
<td class="ClassGridRow2">
<div class="ClassGridBox2">Thursday, September 20</div>
</td>
<td class="ClassGridRow3">
<div class="ClassGridBox3"><a id="_ctl0_phMainContent_dgrdClasses__ctl24_hplAddToCart" class="whitelight" href="/validate.aspx?ClassID1=4332&ClassID2=0">Book Now</a></div>
</td>
</tr>
<tr>
<td class="ClassGridRow1" colspan="3">
<hr>
</td>
</tr>
</tbody>
And I am trying to return the value of ClassGridRow1, ClassGridRow2 and ClassGridBox3 if ClassGridRow1 contains the text string
"Address 123"
for example. So far, I have had no luck retrieving anything but just the context node's contents. Can anyone please assist? Most appreciated!
If you have all XPath features available you could select the <div class="ClassGridBox1"> node and mangle the text() with a regex fn:replace:
//tbody/tr/td/div[#class="ClassGridBox1"]/[replace(text(),'(^[a-zA-Z.-]+ [0-9]+).*','$1', 's')]
Demo
Or a bit relaxed with some post text processing:
//tbody/tr/td/div[#class="ClassGridBox1"]/text()
My question is very simple
I am trying to call this source in my public folder in img folder:
src="img/vcc3logo.png"
But I can't display it on my pdf print form
When the customer print for a certification form it needed to display the image. The file of the print.blade.php is located in resources/views/customer-relations/dashboard/print.blade.php
Here is the code in my print.blade.php
{{-- <div class="content">
<div class="clearfix"></div>
<div class="box-body"> --}}
<img src="" height="50" width="50" style="float: right">
<img src="img/vcc3logo.png" height="50" width="50" style="float: left">
<div class="container">
<div class="row">
<div class="text-center">
<p class="text-center maliit">
Republic of the Philippines<br>
National Capital Region<br>
<font>City Government of Valenzuela</font><br>
Office of the City Mayor<br>
Valenzuela City Command and Communications Center<br>
2nd Floor, City ALERT Center, Mc-Arthur Hi-way, Malinta, Valenzuela City<br>
</p>
<h3>Application Number:{{ $application_number }}</h3>
</div>
<h5><b>Business Name:</b> {{ $business_name }}</h5>
<h5><b>Owner:</b> {{ $owner }}</h5>
<h5><b>Location:</b> {{ $location }}</h5>
</span>
<table class="table table-hover">
<thead>
<tr>
<th>Fees</th>
<th></th>
<th class="text-center"></th>
<th class="text-center"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-md-9"><em>Inspection Fee:</em></h4></td>
<td class="col-md-1" style="text-align: center"></td>
<td class="col-md-1 text-center"></td>
<td class="col-md-1 text-center">{{ $inspection_fee }}</td>
</tr>
<tr>
<td class="col-md-9"><em>Certificate Fee:</em></h4></td>
<td class="col-md-1" style="text-align: center"></td>
<td class="col-md-1 text-center"></td>
<td class="col-md-1 text-center">{{ $cert_fee }}</td>
</tr>
<tr>
<td class="col-md-9"><em>Local Fee:</em></h4></td>
<td class="col-md-1" style="text-align: center"></td>
<td class="col-md-1 text-center"></td>
<td class="col-md-1 text-center">{{ $local_fee }}</td>
</tr>
<tr>
<td class="col-md-9"><em>Others Fee:</em></h4></td>
<td class="col-md-1" style="text-align: center"></td>
<td class="col-md-1 text-center"></td>
<td class="col-md-1 text-center">{{ $others_fee }}</td>
</tr>
</tbody>
</table>
<p><i>Note: Please print and present to Customer Relations Officer</i></p>
</td>
</div>
{{-- </div>
</div>
</div>
--}}
I tried to change it to
src="url('/img/cctv_camera.jpg')"
but ended up with this error:
(1/1) RuntimeException
The exit status code '1' says something went wrong:
stderr: "Loading pages (1/6)
If image file is located inside public folder then you need to add asset() which give full path of image like
<img src="{{asset('/img/vcc3logo.png')}}" height="50" width="50" style="float: left">
I think you can try this hope its help for you :
<img src="{{url('')}}/img/vcc3logo.png" height="50" width="50" style="float: left">
OR
<img src="{{asset('/img/vcc3logo.png')}}" height="50" width="50" style="float: left">
Hope this work for you !!!
This is how it looks in GMail mobile app when sent from Outlook:
How can I avoid those big gaps?
My code is as follows:
<table id="sig" width='320' cellspacing='0' cellpadding='0' border-spacing='0' style="width:320px;margin:0;padding:0;">
<tr>
<td valign='top' width="120" height="48" style="width:120px;height:48px;margin:0;padding:0;vertical-align:top;">
<a style="border:none;text-decoration:none;">
<img moz-do-not-send="true" src="https://s3.amazonaws.com/media_crisalix/signatures/logo.jpg" alt="Crisalix" width='120' height='48' style="border:none;width:120px;height:48px;display:block;">
</a>
</td>
</tr>
<tr>
<td>
<table id="sig1" cellspacing='0' width='320' cellpadding='0' border-spacing='0' style="padding:0;margin:0;font-family:sans-serif,Arial,'Helvetica Neue',Helvetica;mso-line-height-rule:exactly;line-height:11px;color:#b0b0b0;border-collapse:collapse;-webkit-text-size-adjust:none;width:320px;">
<tr style="margin:0;padding:0;">
<td style="width:320px;margin:0;padding:0;font-family:sans-serif,Arial,'Helvetica Neue',Helvetica;white-space:nowrap;font-weight:600;line-height:1.6;font-size:13px;">
<span style="color:#137191">Jaime</span>
</td>
</tr>
<tr style="margin:0;padding:0;">
<td style="width:320px;margin:0;padding:0;font-family:sans-serif,Arial,'Helvetica Neue',Helvetica;white-space:nowrap;font-size:12px;line-height:1">
<span style="color:#555555">Chief Executive Officer</span>
</td>
</tr>
<tr>
<td valign='top' width="27" height='21' style="width:27px;height:1px;margin:0;padding:0;vertical-align:top;">
<img moz-do-not-send="true" src="https://s3.amazonaws.com/media_crisalix/signatures/separator.jpg" alt="Crisalix" width='27' height='21' style="border:none;width:27px;height:21px;display:block;">
</td>
</tr>
<tr style="margin:0;padding:0;">
<td style="width:320px;margin:0;padding:0;font-family:sans-serif,Arial,'Helvetica Neue',Helvetica;white-space:nowrap;font-size:12px;line-height:1.4;">
<div><span style="color:#137191;font-weight:bold">P / </span><span style="color:#555555;"></span></div>
<div><span style="color:#137191;font-weight:bold">A / </span><span style="color:#555555">Parc Scientifique (PSE-A) - EPFL1015</span></div>
<div> <span style="color:#555555"> Lausanne | Switzerland </span></div>
</td>
</tr>
<tr style="margin:0;padding:0;">
<td style="margin:0;padding:0;font-family:sans-serif,Arial,'Helvetica Neue',Helvetica;white-space:nowrap;font-weight:600;line-height:1.6;font-size:13px;width:320px;">
<span style="color:#137191;border:none;text-decoration:none!important;color:#137191;">www.crisalix.com</span>
</td>
</tr>
<tr>
<td valign='top' width="27" height='21' style="width:27px;height:1px;margin:0;padding:0;vertical-align:top;">
<img moz-do-not-send="true" src="https://s3.amazonaws.com/media_crisalix/signatures/separator.jpg" alt="Crisalix" width='27' height='21' style="border:none;width:27px;height:21px;display:block;">
</td>
</tr>
</td>
</table>
</tr>
<tr>
<td valign='top' width="230" height="225" style="width:230px;height:225px;margin:0;padding:0;vertical-align:top;">
<a href='http://www.crisalix.com' title="Crisalix" style="border:none;text-decoration:none;">
<img moz-do-not-send="true" src="https://s3.amazonaws.com/media_crisalix/signatures/signature-banner.jpg" alt="Crisalix" width='230' height='225' style="border:none;width:230px;height:225px;display:block;">
</a>
</td>
</tr>
</table>
I have html like the following:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="2">
<tr>
<td height="20" colspan="2">
</td>
</tr>
<tr>
<td height="20" colspan="2" class="fontDestaque2NegritoHome">
MATRÍCULA: PPAAG
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
</td>
<td align="right" valign="middle" class="tx_bd">
</td>
</tr>
<tr>
<td width="35%" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Fabricante:</span>
</div>
</td>
<td width="59%" align="right" valign="middle" class="tx_bd">
<div align="left">
CESSNA AIRCRAFT</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Modelo:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
T206H</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número de Série:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
T20608735</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
Tipo ICAO :
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
C206</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Tipo de Habilitação para Pilotos:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
MNTE</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Classe da Aeronave:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
POUSO CONVECIONAL 1 MOTOR CONVENCIONAL</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Peso Máximo de Decolagem:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
1633 - Kg</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número Máximo de Passageiros:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
005</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" background="../images/bgPontilhado.gif"
class="tx_bd">
<div align="left">
<img src="../images/bgPontilhado.gif" width="4" height="1"></div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Categoria de Registro:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
PRIVADA SERVICO AEREO PRIVADOS</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Número dos Certificados (CM - CA)</span>:
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
19040</div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Situação no RAB:</span><span class="stop_litle">
</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="fontRed">ARRENDAMENTO OPERACIONAL/ALIENACAO FIDUCIARIA</span></div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Data da Compra/Transferência:</span>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" background="../images/bgPontilhado.gif"
class="tx_bd">
<div align="left">
<img src="../images/bgPontilhado.gif" width="4" height="1"></div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
</div>
</td>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Data de Validade do CA: </span>
</div>
</td>
<td width="3%" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bd">21/05/16</span></div>
</td>
</tr>
<tr>
<td align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
<div align="left">
Data de Validade da IAM:
</div>
</div>
</td>
<td align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bd">110513</span></div>
</td>
</tr>
<tr>
<td height="18" align="right" valign="middle" class="tx_bd">
<div align="left">
<span class="tx_bold">Situação de Aeronavegabilidade:</span>
</div>
</td>
<td height="18" align="right" valign="middle" class="tx_bd">
<div align="left">
Normal</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left" class="tx_bold">
Motivo(s):
</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="right" valign="middle" class="tx_bd">
<div align="left">
<blockquote>
<p>
<span class="tx_bold"></span>
</p>
</blockquote>
</div>
</td>
</tr>
<tr>
<td height="18" colspan="2" align="left" valign="middle" class="tx_bd">
Consulta realizada em: 16/8/2012 15:52:45<br>
</td>
</tr>
I want to grab the following text:
Cessna Aircraft
T206H
T20608735
C206
MNTE
POUSO CONVECIONAL 1 MOTOR CONVENCIONAL
1633 - Kg
005
PRIVADA SERVICO AEREO PRIVADOS
19040
ARRENDAMENTO OPERACIONAL/ALIENACAO FIDUCIARIA
21/05/16
110513
Normal
Some of the div's just contain the text I need. Other div's contain a span that contains the text I need. How would I construct the xpath for this?
Use:
//tr/td[#align='right' and #valign='middle' and #class='tx_bd']
/div[#align='left 'and not(*)]
/text()