-1

How to find right XPath to this html page, I have a problem with text after symbol « . I use xcode 6 and hpple library. Thanks for answers.

<div class="no_main2">
<div class="margin_main2">
<div class="ww1"></div>   
<div class="content_body2">
<!--Content-->
    <div class="con2">
        <script language="javascript">

</script>
 ....
  <tr>      
    <td align="center" valign="top">
        <!--<img src="/m/12_100229_1_93825.jpg">  -->

          <table border="0" cellspacing="0" cellpadding="0" style="width: 100%">
<tr valign="top">
<td valign="top" style=" width: 100%; ">
<p align="left">
 Text text  text text text text text text text text text</strong>. </p>

  </td>
  </tr>
 </table>
  <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;">
    <tr valign="top">
   <td valign="top" style=" width: 100%; ">
    <p align="left">
 text text text text text text text text text text 
  <br> 
  <br><em>« text text text text text text text text text text text»</em>, -          text text text text text text text text text.
  <br></p>

 ....
rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • _"I have a problem with text after symbol «"_ >>> can you explain the problem you are having? It's hard to help unless we know what the problem is. Welcome to SO, take a minute and see [ask] if you need help asking. – Abel Sep 07 '15 at 20:15
  • If page have «, text doesnt parsing – Destroy Man Sep 07 '15 at 20:16
  • You are asking for an XPath expression to the page, but an XPath expression does not select a page but an element in a tree. The HTML above is not XML (how does it look after hpple?). XPath does not do parsing. The HTML above, when rendered in a browser parses just fine (the `«` part is shown). In short, I'm still lost and need your help to help you. We'd really need more info. Please read [mcve] and update your post. – Abel Sep 07 '15 at 20:18

1 Answers1

0

If you are asking for the xpath that can locate that element then it is:-

//em[contains(.,'text')]

now if you want exact text after << then you can refer below referance :-

http://stackoverflow.com/questions/5756256/trim-spaces-from-end-of-a-nsstring

Hope it will help you :)

Get back to me if still facing any issue

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125