title: selenium python could not get text of tbody's element
body: <p>I have a python code that takes fake mail - sign up a website - then need to enter the code</p>
  <p>I use this temp mail service -&gt; <a href="https://www.mohmal.com/en/inbox" rel="nofollow noreferrer">mohmal.com</a></p>
  <p>the inspect HTML is</p>
  <pre><code>&lt;tbody&gt;&lt;tr&gt;
  &lt;td colspan=&quot;3&quot; align=&quot;center&quot; valign=&quot;middle&quot; style=&quot;padding-bottom:20px;&quot;&gt;
  &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; class=&quot;container&quot; style=&quot;width:96%;&quot;&gt;
  &lt;tbody&gt;&lt;tr&gt;
  &lt;td style=&quot;font-size:14px; line-height:16px;&quot;&gt;
  Mr. Smith,
  &lt;br&gt; some text
  &lt;br&gt; some text
  &lt;br&gt; some text
  &lt;br&gt;&lt;br&gt;&lt;b&gt;614126&lt;/b&gt;&lt;br&gt; 
  &lt;br&gt; some text
  &lt;br&gt; some text
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  <p>I need the <strong>614126</strong> verification code,</p>
  <p>my python code is;</p>
  <pre><code>theCode = &quot;&quot;
  a = driver.find_element_by_css_selector(&quot;body &gt; table &gt; tbody &gt; tr &gt; td &gt; table:nth-child(2) &gt; tbody &gt; tr &gt; td &gt; table &gt; tbody &gt; tr &gt; td &gt; b&quot;)
  theCode = a.text
  print(theCode )
  </code></pre>
  <p>it gives me nothing, I tried</p>
  <p><a href="https://www.guru99.com/selenium-webtable.html" rel="nofollow noreferrer">https://www.guru99.com/selenium-webtable.html</a></p>
  <p>these methods, but it didn't work</p>
  <p><strong>EDIT 1:</strong></p>
  <p>the x path the code from insect is like this;</p>
  <pre><code>/html/body/table/tbody/tr/td/table[2]/tbody/tr/td/table/tbody/tr/td/b
  </code></pre>