Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Remove <code>tbody/</code> from your XPath.</p> <p>The <code>tbody</code> tag is part of the HTML spec for <code>table</code> tags, but it's rarely actually implemented in the HTML. Some browsers insert it, though it's not in the HTML for the page. Firebug then sees it, which you see, and think it must be so.</p> <p>Even using "view source" can confuse you, because you expect that to be accurate, but the browser has already munged the content to include "tbody", so, well, basically they're lying to you.</p> <p>You can confirm this by looking at the HTML that Nokogiri is getting. Use <code>puts doc.to_html['tbody']</code> and see if you get <code>"tbody"</code> or <code>nil</code>. </p> <hr> <blockquote> <p>...Because in html file all of them were specified(written by programmer)</p> </blockquote> <p>If you are positive they actually belong there, because they exist in the HTML source, then you'll need to take apart your XPath. Start with a broad path, and slowly add to it to narrow down your search.</p> <p>The server is unreachable for me right now, so I can't confirm that, or dig into what the hierarchy should be, and show an example. (That's why actually giving us REAL HTML in your question is SO much better than a link which might not work.)</p> <p>An alternate is to use XPath's <code>//</code> (search anywhere) with a less restrictive path, or CSS selectors. Either way, actually examine the HTML, instead of relying on Firebug's XPath, and determine what "landmarks" you can use in the source to navigate to your desired table. Today's HTML is chock-full of <code>id</code> and <code>class</code> parameters, or a particular series of tags that act as a finger-print for the table you want. Search for the minimum needed to pin-point that table.</p> <p>If the table is something like <code>&lt;table id="foo"&gt;</code>, then use <code>doc.at('table#foo')</code>. If it's in a <code>&lt;div class="bar"&gt;&lt;table&gt;</code> use <code>doc.at('div.bar table')</code>. In any case, use the smallest sized accessor necessary to get the job done. That will increase your chances of success if anything in the HTML changes in the future.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload