title: hey, i would like to make a Selenium Bot in Python that solves Driving School questions
body: <p>How to fetch the questionNumber with Selenium?</p>
  <p>I already have this
  like I already have the login process but I want to fetch the question numbers to google them and return the answers found on google.</p>
  <pre><code>driver = webdriver.Chrome()
  
  driver.get(&quot;https://www.windrive-theorietrainer.de/tt/questionnaires/category/questionnaire/3&quot;)
  time.sleep(5)
  lol = driver.find_element_by_id(&quot;email&quot;)
  lol.send_keys(&quot;email@example.com&quot;)
  lol = driver.find_element_by_id(&quot;password&quot;)
  lol.send_keys(&quot;1233123123&quot;)
  driver.find_element_by_xpath('//button[@type=&quot;submit&quot;]').click()
  
  driver.execute_script(&quot;window.open('&quot; + &quot;https://www.windrive-theorietrainer.de/tt/questionnaires/exercise/questionnaire&quot; +&quot;');&quot;)
  time.sleep(5)
  elements = driver.find_element_by_name('class=&quot;questionNumber&quot;')
  </code></pre>
  <p>but it just tells me that this is a illegal method any ideas to fix?</p>
  <pre><code>&lt;tt-questionnaire _nghost-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;
    &gt;&lt;kendo-dialog
      _ngcontent-nbk-c271=&quot;&quot;
      id=&quot;questionnaireModal&quot;
      class=&quot;ng-tns-c62-66 k-dialog-wrapper ng-star-inserted&quot;
      tabindex=&quot;0&quot;
      dir=&quot;ltr&quot;
      &gt;&lt;div
        class=&quot;k-overlay ng-tns-c62-66 ng-trigger ng-trigger-overlayAppear&quot;
      &gt;&lt;/div&gt;
      &lt;div
        role=&quot;dialog&quot;
        class=&quot;k-widget k-window k-dialog ng-tns-c62-66 ng-trigger ng-trigger-dialogSlideInAppear&quot;
      &gt;
        &lt;!----&gt;&lt;!----&gt;
        &lt;div class=&quot;k-content k-window-content k-dialog-content ng-tns-c62-66&quot;&gt;
          &lt;div
            _ngcontent-nbk-c271=&quot;&quot;
            id=&quot;questionnaireContainer&quot;
            class=&quot;ng-tns-c62-66 ng-star-inserted&quot;
            style=&quot;&quot;
          &gt;
            &lt;!----&gt;
            &lt;div
              _ngcontent-nbk-c271=&quot;&quot;
              id=&quot;questionnaire&quot;
              class=&quot;ng-star-inserted&quot;
              style=&quot;&quot;
            &gt;
              &lt;div _ngcontent-nbk-c271=&quot;&quot; id=&quot;questionnaireHeader&quot;&gt;
                &lt;div _ngcontent-nbk-c271=&quot;&quot; class=&quot;title&quot;&gt;
                  &lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;class&quot;
                    &gt;Grundstoff&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/span
                  &gt;&lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;questionNumber&quot;
                    &gt;1.2.05-101&lt;/span
                  &gt;&lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;currentQuestion&quot;
                    &gt;Aufgabe 1&lt;/span
                  &gt;&lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;points&quot;&gt;Punkte: 4&lt;/span&gt;
                &lt;/div&gt;
                &lt;ul _ngcontent-nbk-c271=&quot;&quot; class=&quot;languageSelection&quot;&gt;
                  &lt;tt-language-dropdown _ngcontent-nbk-c271=&quot;&quot; _nghost-nbk-c241=&quot;&quot;
                    &gt;&lt;!----&gt;&lt;/tt-language-dropdown
                  &gt;
                &lt;/ul&gt;
              &lt;/div&gt;
              &lt;div _ngcontent-nbk-c271=&quot;&quot; id=&quot;questionnaireContent&quot;&gt;
                &lt;!----&gt;&lt;tt-questionnaire-question
                  _ngcontent-nbk-c271=&quot;&quot;
                  _nghost-nbk-c270=&quot;&quot;
                  class=&quot;ng-star-inserted&quot;
                  &gt;&lt;h2 _ngcontent-nbk-c270=&quot;&quot; class=&quot;question&quot;&gt;
                    &lt;tt-tts _ngcontent-nbk-c270=&quot;&quot; _nghost-nbk-c243=&quot;&quot;
                      &gt;&lt;div _ngcontent-nbk-c243=&quot;&quot;&gt;
                        &lt;span _ngcontent-nbk-c270=&quot;&quot;
                          &gt;Wo ist das Überholen verboten?&lt;/span
                        &gt;
                      &lt;/div&gt;
                      &lt;!----&gt;&lt;/tt-tts
                    &gt;
                  &lt;/h2&gt;
                  &lt;div _ngcontent-nbk-c270=&quot;&quot; class=&quot;row mb-3&quot;&gt;
                    &lt;div _ngcontent-nbk-c270=&quot;&quot; class=&quot;col-6 mediaContainer&quot;&gt;
                      &lt;!----&gt;&lt;!----&gt;&lt;!----&gt;
                    &lt;/div&gt;
                    &lt;div _ngcontent-nbk-c270=&quot;&quot; class=&quot;col-6 answer&quot;&gt;
                      &lt;tt-questionnaire-selection-question
                        _ngcontent-nbk-c270=&quot;&quot;
                        _nghost-nbk-c268=&quot;&quot;
                        class=&quot;ng-star-inserted&quot;
                        &gt;&lt;div
                          _ngcontent-nbk-c268=&quot;&quot;
                          class=&quot;selectionQuestionContainer&quot;
                        &gt;
                          &lt;!----&gt;
                          &lt;ul _ngcontent-nbk-c268=&quot;&quot; class=&quot;answers&quot;&gt;
                            &lt;li _ngcontent-nbk-c268=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                              &lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerCheckbox ng-star-inserted&quot;
                                &gt;&lt;input
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  type=&quot;checkbox&quot;
                                  autocomplete=&quot;off&quot;
                                  id=&quot;answerCheckbox1&quot;
                                  class=&quot;ng-untouched ng-pristine ng-valid&quot; /&gt;&lt;label
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  for=&quot;answerCheckbox1&quot;
                                &gt;&lt;/label&gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerSelectionText ng-star-inserted&quot;
                                &gt;&lt;tt-tts
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  _nghost-nbk-c243=&quot;&quot;
                                  &gt;&lt;div _ngcontent-nbk-c243=&quot;&quot;&gt;
                                    &lt;span _ngcontent-nbk-c268=&quot;&quot;
                                      &gt;In allen Einbahnstraßen&lt;/span
                                    &gt;
                                  &lt;/div&gt;
                                  &lt;!----&gt;&lt;/tt-tts
                                &gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;!----&gt;
                            &lt;/li&gt;
                            &lt;li _ngcontent-nbk-c268=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                              &lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerCheckbox ng-star-inserted&quot;
                                &gt;&lt;input
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  type=&quot;checkbox&quot;
                                  autocomplete=&quot;off&quot;
                                  id=&quot;answerCheckbox2&quot;
                                  class=&quot;ng-untouched ng-pristine ng-valid&quot; /&gt;&lt;label
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  for=&quot;answerCheckbox2&quot;
                                &gt;&lt;/label&gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerSelectionText ng-star-inserted&quot;
                                &gt;&lt;tt-tts
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  _nghost-nbk-c243=&quot;&quot;
                                  &gt;&lt;div _ngcontent-nbk-c243=&quot;&quot;&gt;
                                    &lt;span _ngcontent-nbk-c268=&quot;&quot;
                                      &gt;Wo die Verkehrslage unklar ist&lt;/span
                                    &gt;
                                  &lt;/div&gt;
                                  &lt;!----&gt;&lt;/tt-tts
                                &gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;!----&gt;
                            &lt;/li&gt;
                            &lt;li _ngcontent-nbk-c268=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                              &lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerCheckbox ng-star-inserted&quot;
                                &gt;&lt;input
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  type=&quot;checkbox&quot;
                                  autocomplete=&quot;off&quot;
                                  id=&quot;answerCheckbox3&quot;
                                  class=&quot;ng-untouched ng-pristine ng-valid&quot; /&gt;&lt;label
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  for=&quot;answerCheckbox3&quot;
                                &gt;&lt;/label&gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;span
                                _ngcontent-nbk-c268=&quot;&quot;
                                class=&quot;answerSelectionText ng-star-inserted&quot;
                                &gt;&lt;tt-tts
                                  _ngcontent-nbk-c268=&quot;&quot;
                                  _nghost-nbk-c243=&quot;&quot;
                                  &gt;&lt;div _ngcontent-nbk-c243=&quot;&quot;&gt;
                                    &lt;span _ngcontent-nbk-c268=&quot;&quot;
                                      &gt;Wo der Gegenverkehr behindert werden
                                      könnte&lt;/span
                                    &gt;
                                  &lt;/div&gt;
                                  &lt;!----&gt;&lt;/tt-tts
                                &gt;&lt;/span
                              &gt;&lt;!----&gt;&lt;!----&gt;
                            &lt;/li&gt;
                            &lt;!----&gt;
                          &lt;/ul&gt;
                        &lt;/div&gt;&lt;/tt-questionnaire-selection-question
                      &gt;&lt;!----&gt;&lt;!----&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;!----&gt;&lt;!----&gt;&lt;/tt-questionnaire-question
                &gt;&lt;!----&gt;
              &lt;/div&gt;
              &lt;div _ngcontent-nbk-c271=&quot;&quot; id=&quot;questionnaireButtons&quot;&gt;
                &lt;div _ngcontent-nbk-c271=&quot;&quot; class=&quot;questionsLeft&quot;&gt;
                  &lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;
                    &gt;&lt;i
                      _ngcontent-nbk-c271=&quot;&quot;
                      class=&quot;fa fa-exclamation-triangle&quot;
                    &gt;&lt;/i
                    &gt;&lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;
                      &gt;noch 30 Aufgaben&lt;/span
                    &gt;&lt;!----&gt;&lt;!----&gt;&lt;/span
                  &gt;&lt;!----&gt;
                &lt;/div&gt;
                &lt;div _ngcontent-nbk-c271=&quot;&quot; class=&quot;buttons&quot;&gt;
                  &lt;button
                    _ngcontent-nbk-c271=&quot;&quot;
                    class=&quot;finishQuestionnaire ng-star-inserted&quot;
                  &gt;
                    Abgabe&lt;/button
                  &gt;&lt;!----&gt;&lt;!----&gt;&lt;button
                    _ngcontent-nbk-c271=&quot;&quot;
                    class=&quot;markQuestion ng-star-inserted&quot;
                  &gt;
                    Markieren&lt;/button
                  &gt;&lt;!----&gt;&lt;!----&gt;&lt;button
                    _ngcontent-nbk-c271=&quot;&quot;
                    class=&quot;nextQuestion ng-star-inserted&quot;
                  &gt;
                    Weiter&lt;/button
                  &gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;button
                    _ngcontent-nbk-c271=&quot;&quot;
                    class=&quot;showExplanation ng-star-inserted&quot;
                  &gt;
                    &lt;span _ngcontent-nbk-c271=&quot;&quot;&gt;Erklärung&lt;/span
                    &gt;&lt;span
                      _ngcontent-nbk-c271=&quot;&quot;
                      class=&quot;k-icon k-i-question&quot;
                    &gt;&lt;/span&gt;&lt;/button
                  &gt;&lt;!----&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;!----&gt;&lt;!----&gt;&lt;!----&gt;
              &lt;div _ngcontent-nbk-c271=&quot;&quot; id=&quot;questionnaireNav&quot;&gt;
                &lt;div
                  _ngcontent-nbk-c271=&quot;&quot;
                  id=&quot;questionnaireNavClasses&quot;
                  class=&quot;ng-star-inserted&quot;
                &gt;
                  &lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;active ng-star-inserted&quot;&gt;
                    &lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;
                      &gt;Grundstoff&lt;/span
                    &gt;&lt;!----&gt;&lt;!----&gt;&lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    &lt;!----&gt;&lt;span _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;
                      &gt;B&lt;/span
                    &gt;&lt;!----&gt;&lt;!----&gt;&lt;/button
                  &gt;&lt;!----&gt;
                &lt;/div&gt;
                &lt;!----&gt;
                &lt;div
                  _ngcontent-nbk-c271=&quot;&quot;
                  id=&quot;questionnaireNavButtons&quot;
                  class=&quot;ng-star-inserted&quot;
                &gt;
                  &lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted active&quot;&gt;
                    1
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    2
                    &lt;i
                      _ngcontent-nbk-c271=&quot;&quot;
                      class=&quot;fa fa-play-circle-o video ng-star-inserted&quot;
                    &gt;&lt;/i
                    &gt;&lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    3
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    4
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    5
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    6
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    7
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    8
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    9
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    10
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    11
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    12
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    13
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    14
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    15
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    16
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    17
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    18
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    19
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;button _ngcontent-nbk-c271=&quot;&quot; class=&quot;ng-star-inserted&quot;&gt;
                    20
                    &lt;!----&gt;&lt;/button
                  &gt;&lt;!----&gt;
                &lt;/div&gt;
                &lt;!----&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;!----&gt;
          &lt;/div&gt;
          &lt;!----&gt;&lt;!----&gt;
        &lt;/div&gt;
        &lt;!----&gt;&lt;!----&gt;
      &lt;/div&gt;&lt;/kendo-dialog
    &gt;&lt;!----&gt;&lt;/tt-questionnaire
  &gt;
  
  </code></pre>
  <p>If you find a way let me know I would also +rep it :)</p>