title: Getting the next UL element using BeautifulSoup
body: <p>I'm trying to find the next ul element in a give webpage.</p>
  
  <p>I start by plugging in my response into Beautiful Soup like so:</p>
  
  <pre><code>soup = BeautifulSoup(response.context)
  </code></pre>
  
  <p>printing out response.context gives the following</p>
  
  <pre><code>print(response.context)
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt; | FollowUp&lt;/title&gt;
          &lt;meta name='viewport' content='width=device-width, initial-scale=1.0'&gt;
          &lt;link href='/static/css/bootstrap.min.css' rel='stylesheet' media='screen'&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div class='navbar'&gt;
              &lt;div class='navbar-inner'&gt;
                  &lt;a class='brand' href='/'&gt;TellMe.cat&lt;/a&gt;
                  &lt;ul class='nav'&gt;
                      &lt;li&gt;&lt;a href='list'&gt;My Stories&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href='add'&gt;Add Story&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href='respond'&gt;Add Update&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
  
                  &lt;form class='navbar-form pull-right' action='process_logout' method='post'&gt;
                      &lt;input type='hidden' name='csrfmiddlewaretoken' value='RxquwEsaS5Bn1MsKOIJP8uLtRZ9yDusH' /&gt;
                      Hello add!
                      &lt;button class='btn btn-small'&gt;Logout&lt;/button&gt;
                  &lt;/form&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class='container'&gt;
  
  &lt;ul id='items'&gt;
  &lt;ul&gt;
  &lt;li&gt;&lt;a href='http://www.example.org'&gt;http://www.example.org&lt;/a&gt;&lt;/li&gt;
  &lt;ul&gt;
  &lt;p&gt;There have been no follow ups.&lt;/p&gt;
  &lt;/ul&gt;
  &lt;/ul&gt;
  &lt;/ul&gt;
  
          &lt;/div&gt;
  
          &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src='/static/js/bootstrap.min.js'&gt;&lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm trying to get the ul that's named 'items'. I do so with:</p>
  
  <pre><code>items = soup.find(id='items')
  </code></pre>
  
  <p>Which gives me the correct ul and all of its children. However calling</p>
  
  <pre><code>items.find_next('ul')
  </code></pre>
  
  <p>Gives the error of</p>
  
  <pre><code>TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>Even though this seems to be how it's supposed to be called accorind to the Beautiful Soup docs: <a href="https://beautiful-soup-4.readthedocs.org/en/latest/#find-all-next-and-find-next" rel="nofollow">https://beautiful-soup-4.readthedocs.org/en/latest/#find-all-next-and-find-next</a></p>
  
  <p>What am I doing incorrectly?</p>