title: Access other Cell Contents within cell (Colab)
body: <p>Good Afternoon from Germany, everybody!</p>
  <p>Google Colab and I seem to have divergent opinions on what is possible or not...
  I just want a way to access the contents of all other cells from within a cell.</p>
  <p>My use case is, that I want to POST the contents of a current Colab Notebook to an external server for grading with minimal user interaction (just running the cell).</p>
  <p>So my question is: <em>Is there a way to access the code cells of a Colab NB programmatically?</em></p>
  <p>I saw <a href="https://stackoverflow.com/questions/51121647/get-the-current-contents-of-the-entire-jupyter-notebook">this answer</a> for Jupyter NB, but it does not work in Google Colab as the <code>Jupyter</code> JS-Variable is not available. The variable <code>google.colab</code> seems to not provide the same functionality, or am I missing something?</p>
  <p>Google Colab seems to sandbox each cell in its one iframe, so I cannot query the contents of other cells via JS:</p>
  <pre class="lang-js prettyprint-override"><code>    %%js
      document.getElementsByClassName('cell')
  </code></pre>
  <p>When run in a cell this just leads to an empty HTMLCollection, when run in the Developer Tools of my browser I get the correct results.</p>
  <p>Am I missing something here? Is there a way to escape the sandbox or access the current NB contents within a Python cell?</p>
  <p>Thanks in Advance for your help!</p>