title: How to Scroll down a Dialog box with Selenium + Python
body: <p>I have a dialog box from a medical web app which shows only 30 patients in the first screen, to view more pacients i have scroll down the dialog box and when i close to the thirtieth pacient it shows 30 more.</p>
  
  <p>I'm trying to show more than 2000 paciente on that dialog box while I'm opening in a new window their link profile and collecting info and saving in a xmls file.</p>
  
  <p>How can I scroll down using Python + Selenium?</p>
  
  <p>This is the dialog box screen:</p>
  
  <p><a href="https://i.stack.imgur.com/5CEXs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5CEXs.png" alt="Dialog Box"></a></p>
  
  <p>This html is the dialog box with the 6 first firsts patients and 
  thirtieth, I couldn't post all the 30 (character limit):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;md-dialog aria-label="Pacientes" ng-form="mainForm" flex="70" flex-xl="40" class="ng-pristine ng-valid _md flex-xl-40 flex-70 md-transition-in" role="dialog" tabindex="-1" aria-describedby="dialogContent_573" style=""&gt;
      &lt;md-toolbar md-theme="white" class="_md md-white-theme _md-toolbar-transitions"&gt;
          &lt;div class="md-toolbar-tools layout-wrap layout-row" layout="row" layout-wrap=""&gt;
              &lt;h2 flex="100" flex-gt-xs="50" class="flex-gt-xs-50 flex-100"&gt;Pacientes&lt;/h2&gt;
              &lt;md-input-container flex="100" flex-gt-xs="50" md-no-float="" style="padding: 0;" class="md-input-has-placeholder md-white-theme flex-gt-xs-50 flex-100"&gt;
                  &lt;input type="text" placeholder="Pesquisar" ng-model="pacienteCtrl.search" ng-change="pacienteCtrl.onChangeSearch()" class="ng-pristine ng-untouched ng-valid md-input ng-empty" id="input_572" aria-invalid="false" style=""&gt;&lt;div class="md-errors-spacer"&gt;&lt;/div&gt;
              &lt;/md-input-container&gt;
          &lt;/div&gt;
      &lt;/md-toolbar&gt;
  
      &lt;md-dialog-content class="md-dialog-content" when-scrolled="pacienteCtrl.nextPage()" id="dialogContent_573"&gt;
          &lt;div layout="column" class="layout-column"&gt;
              &lt;md-divider&gt;&lt;/md-divider&gt;
              &lt;md-list class="sd-list-pacientes" role="list"&gt;
                  &lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem" style=""&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-574" ng-href="https://app.simplesdental.com/simples/pacientes/11489833/sobre" href="https://app.simplesdental.com/simples/pacientes/11489833/sobre"&gt;
      
      Abraão Laurentino dos Santos
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.cpf"&gt;
                                  &lt;md-icon md-svg-icon="person" role="img" aria-label="person"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M24 24c4.42 0 8-3.59 8-8 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 4.41 3.58 8 8 8zm0 4c-5.33 0-16 2.67-16 8v4h32v-4c0-5.33-10.67-8-16-8z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;xxx.xxx.xxx-xx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-575" ng-href="https://app.simplesdental.com/simples/pacientes/11827315/sobre" href="https://app.simplesdental.com/simples/pacientes/11827315/sobre"&gt;
      
      Acyr Xavier Moreira
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.cpf"&gt;
                                  &lt;md-icon md-svg-icon="person" role="img" aria-label="person"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M24 24c4.42 0 8-3.59 8-8 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 4.41 3.58 8 8 8zm0 4c-5.33 0-16 2.67-16 8v4h32v-4c0-5.33-10.67-8-16-8z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;xxx.xxx.xxx-xx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-576" ng-href="https://app.simplesdental.com/simples/pacientes/17258954/sobre" href="https://app.simplesdental.com/simples/pacientes/17258954/sobre"&gt;
      
      Adilton Junior
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.cpf"&gt;
                                  &lt;md-icon md-svg-icon="person" role="img" aria-label="person"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M24 24c4.42 0 8-3.59 8-8 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 4.41 3.58 8 8 8zm0 4c-5.33 0-16 2.67-16 8v4h32v-4c0-5.33-10.67-8-16-8z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;xxx.xxx.xxx-xx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-577" ng-href="https://app.simplesdental.com/simples/pacientes/15922853/sobre" href="https://app.simplesdental.com/simples/pacientes/15922853/sobre"&gt;
      
      Adalberto Cortes da Silva
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.cpf"&gt;
                                  &lt;md-icon md-svg-icon="person" role="img" aria-label="person"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M24 24c4.42 0 8-3.59 8-8 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 4.41 3.58 8 8 8zm0 4c-5.33 0-16 2.67-16 8v4h32v-4c0-5.33-10.67-8-16-8z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;xxx.xxx.xxx-xx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-578" ng-href="https://app.simplesdental.com/simples/pacientes/13516998/sobre" href="https://app.simplesdental.com/simples/pacientes/13516998/sobre"&gt;
      
      Adalton Barbosa Cardoso Cunha
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.cpf"&gt;
                                  &lt;md-icon md-svg-icon="person" role="img" aria-label="person"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M24 24c4.42 0 8-3.59 8-8 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 4.41 3.58 8 8 8zm0 4c-5.33 0-16 2.67-16 8v4h32v-4c0-5.33-10.67-8-16-8z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;xxx.xxx.xxx-xx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-579" ng-href="https://app.simplesdental.com/simples/pacientes/17103848/sobre" href="https://app.simplesdental.com/simples/pacientes/17103848/sobre"&gt;
      
      Adelina de Oliveira
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;&lt;md-list-item class="md-2-line md-no-proxy _md" ng-repeat="paciente in pacienteCtrl.pacientes" paciente-link="" paciente="paciente" role="listitem"&gt;
                      &lt;img ng-src="assets/img/user-default.png" class="md-avatar" src="assets/img/user-default.png"&gt;
                      &lt;div layout="column" class="md-list-item-text layout-column"&gt;
                          &lt;a ng-click="go()" class="sd-link" paciente="paciente" aria-label="Ir para a ficha desse paciente" md-labeled-by-tooltip="md-tooltip-580" ng-href="https://app.simplesdental.com/simples/pacientes/12563381/sobre" href="https://app.simplesdental.com/simples/pacientes/12563381/sobre"&gt;
      
      Alan Albuquerque
     &lt;/a&gt;
                          &lt;div layout="column" layout-gt-sm="row" class="sd-list-pacientes-info layout-gt-sm-row layout-column"&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;&lt;span class="sd-list-pacientes-info-item" ng-if="paciente.celular"&gt;
                                  &lt;md-icon md-svg-icon="phone" role="img" aria-label="phone"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 48 48" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"&gt;&lt;path d="M31 2H15c-2.76 0-5 2.24-5 5v34c0 2.76 2.24 5 5 5h16c2.76 0 5-2.24 5-5V7c0-2.76-2.24-5-5-5zm-8 42c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm9-8H14V8h18v28z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/md-icon&gt;
                                  &lt;span class="grey"&gt;(xx) xxxxx-xxxx&lt;/span&gt;
                              &lt;/span&gt;&lt;!----&gt;
                              &lt;!----&gt;
                              &lt;!----&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;md-divider&gt;&lt;/md-divider&gt;
                  &lt;div class="md-secondary-container"&gt;&lt;/div&gt;&lt;/md-list-item&gt;&lt;!----&gt;
              &lt;/md-list&gt;
          &lt;/div&gt;
          &lt;div layout="column" ng-show="!pacienteCtrl.pacientes.length" layout-align="center center" class="layout-align-center-center layout-column ng-hide" aria-hidden="true" style=""&gt;
              &lt;p class="inset"&gt;Sem resultados para a busca&lt;/p&gt;
          &lt;/div&gt;
      &lt;/md-dialog-content&gt;
  
      &lt;md-dialog-actions layout="row" layout-align="end center" class="layout-align-end-center layout-row"&gt;
          &lt;button class="md-button md-ink-ripple" type="button" ng-transclude="" ng-click="pacienteCtrl.closeDialog()"&gt; Fechar &lt;/button&gt;
      &lt;/md-dialog-actions&gt;
  &lt;/md-dialog&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my code where i'm tryong to scroll down:</p>
  
  <blockquote>
    <p>element = driver.find_element(By.XPATH("//div[@class='md-dialog-container']//md-list-item[30]"))#Select last child of content div
    driver.execute_script("arguments[0].scrollIntoView(true);", element) #Scroll to last child node</p>
  </blockquote>
  
  <p>But I'm receving the message error:</p>
  
  <p>
  element = driver.find_element(By.XPATH("//div[@class='md-dialog-container']//md-list-item[30]")) #Select last child of content div
  TypeError: 'str' object is not callable
  </p>