title: Click checkbox in selenium
body: <p>I want to click this checkbox, I have tried almost all the XPATH but it's not working.</p>
  <p>The following class is from the GOOGLE Forms &gt; Include FORM in Email</p>
  <pre><code>&lt;div id=&quot;c9&quot; class=&quot;quantumWizTogglePapercheckboxEl appsMaterialWizTogglePapercheckboxCheckbox docssharedWizToggleLabeledControl freebirdThemedCheckbox freebirdMaterialWidgetsToggleLabeledCheckbox isCheckedNext&quot; jscontroller=&quot;EcW08c&quot; jsaction=&quot;keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;&quot; jsshadow=&quot;&quot; jsname=&quot;gZKGbc&quot; aria-label=&quot;Include form in email&quot; tabindex=&quot;0&quot; role=&quot;checkbox&quot; aria-checked=&quot;false&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxInk exportInk&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxInnerBox exportInnerBox&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxCheckMarkContainer&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxCheckMark&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxShort exportCheck&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxLong exportCheck&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  <p>There's another class which is similar to above but has a different checkbox.</p>
  <pre><code>&lt;div id=&quot;c6&quot; class=&quot;quantumWizTogglePapercheckboxEl appsMaterialWizTogglePapercheckboxCheckbox docssharedWizToggleLabeledControl freebirdThemedCheckbox freebirdMaterialWidgetsToggleLabeledCheckbox isCheckedNext&quot; jscontroller=&quot;EcW08c&quot; jsaction=&quot;keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;&quot; jsshadow=&quot;&quot; jsname=&quot;JUdOvc&quot; aria-label=&quot;Collect email addresses&quot; tabindex=&quot;0&quot; role=&quot;checkbox&quot; aria-checked=&quot;false&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxInk exportInk&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxInnerBox exportInnerBox&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxCheckMarkContainer&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxCheckMark&quot;&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxShort exportCheck&quot;&gt;&lt;/div&gt;&lt;div class=&quot;quantumWizTogglePapercheckboxLong exportCheck&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  <p>I tried with the following:</p>
  <pre><code>search = driver.find_element_by_xpath(&quot;//*[contains(text(), 'appsMaterialWizTogglePapercheckboxCheckbox')]&quot;)
  </code></pre>
  <p>None of them works and generates the error:</p>
  <pre><code>NoSuchElementException: Message: no such element: Unable to locate element: {&quot;method&quot;:&quot;xpath&quot;,&quot;selector&quot;:&quot;//*[contains(text(), 'appsMaterialWizTogglePapercheckboxCheckbox')]&quot;}
  </code></pre>