Selenium element can not be found within iframe
<p>I am trying to retrieve a JSON element, the problem is that in the source code it doesn't exist, but I can find it via inspect element.  </p>

<p>I have tried with </p>

<pre><code>C.driver.findElement(By.id("ticket-parsed"))
</code></pre>

<p>and via XPath  </p>

<pre><code>C.driver.findElement(By.xpath("//*[@id=\"ticket_parsed\"]"));
</code></pre>

<p>and I can't find it.  </p>

<p>Also </p>

<pre><code>C.driver.switchTo().frame("html5-frame"); 
System.out.println(C.driver.findElement(By.id("ticket_parsed"))); 
C.driver.switchTo().defaultContent();
</code></pre>

<p>i get</p>

<pre><code>[[ChromeDriver: chrome on XP (1f75e50635f9dd5b9535a149a027a447)] -&gt; id: ticket_parsed]  
</code></pre>

<p>on </p>

<pre><code> driver.switchTo().frame(0) or driver.switchTo().frame(1) 
</code></pre>

<p>i get that the frame doesn't exists </p>

<p>and at last i tried </p>

<pre><code> WebElement frame = C.driver.findElement(By.id("html5-frame"));
 C.driver.switchTo().frame(frame.getAttribute("ticket_parsed"));
</code></pre>

<p>an i got a null pointer exception</p>

<p><strong>Here's an image of the source</strong>:</p>

<p><a href="https://i.stack.imgur.com/vRFcF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vRFcF.jpg" alt="enter image description here"></a></p>

<p>what am I doing wrong?</p>