title: How do I scrape this text from an HTML <span id> using Python, Selenium, and BeautifulSoup?
body: <p>I'm working on creating a web scraping tool that generates a .csv report by using Python, Selenium, beautifulSoup, and pandas. </p>
  
  <p>Unfortunately, I'm running into an issue with grabbing the "data-date" text from the HTML below. I am looking to pull the "2/4/2020" into the .csv my code is generating. </p>
  
  <pre><code>&lt;span class="import-popover"&gt;&lt;span id="LargeHeader_glyphStatus" class="glyphicon glyphicon-ok-sign white"&gt;&lt;/span&gt;&lt;b&gt;&lt;span id="LargeHeader_statusText"&gt;Processing Complete&lt;/span&gt;&lt;/b&gt;&lt;span id="LargeHeader_dateText" data-date="2/4/2020" data-delay="1" data-step="3" data-error="False"&gt;, Last Processed 2/5/2020&lt;/span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>My python script starts off with the following: </p>
  
  <pre><code>from selenium import webdriver
  from bs4 import BeautifulSoup as bs
  import pandas as pd
  driver = webdriver.Chrome('C:\chromedriver.exe')
  
  lastdatadate=[]
  lastprocesseddate=[]
  </code></pre>
  
  <p>Then I have it log in to a website, enter my un/pw credentials, and click the continue/login button. </p>
  
  <p>From there, I am using the following to parse the html, scrape the website, and pull the relevant data/text into a .csv:</p>
  
  <pre><code>content = driver.page_source
  soup = bs(content, 'html.parser')
  for a in soup.findAll('div', attrs={'class':'large-header-welcome'}):
      datadate=a.find(?????)
      processeddate=a.find('span', attrs={'id':'LargeHeader_dateText'})
      lastdatadate.append(datadate.text)
      lastprocesseddate.append(processeddate.text)
  
  df = pd.DataFrame({'Last Data Date':lastdatadate,'Last Processed Date':lastprocesseddate}) 
  df.to_csv('hqm.csv', index=False, encoding='utf-8')
  </code></pre>
  
  <p>So far, I've got it working for the "last processed date" component of the HTML, but I am having trouble getting it to pull the "last data date" from the HTML. It's there, I just don't know how to have python find it. I've tried using the find method but I have not been successful. </p>
  
  <p>I've tried googling around and checking here for what I should try, but I've come up empty-handed so far. I think I'm having trouble what to search for. </p>
  
  <p>Any insight would be much appreciated as I am trying to learn and get better. Thanks!</p>
  
  <p>edit: here is a closer look of the HTML:</p>
  
  <pre><code> &lt;div class="large-header-welcome"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-sm-6"&gt;
                  &lt;h3 class="welcome-header"&gt;Welcome, &lt;span id="LargeHeader_fullname"&gt;Rhett&lt;/span&gt;&lt;/h3&gt;
                  &lt;p class=""&gt;
                      &lt;b&gt;Site:&lt;/b&gt; &lt;span id="LargeHeader_Name"&gt;redacted&lt;/span&gt;
                      &lt;br /&gt;
                      &lt;span class="import-popover"&gt;&lt;span id="LargeHeader_glyphStatus" class="glyphicon glyphicon-ok-sign white"&gt;&lt;/span&gt;&lt;b&gt;&lt;span id="LargeHeader_statusText"&gt;Processing Complete&lt;/span&gt;&lt;/b&gt;&lt;span id="LargeHeader_dateText" data-date="2/4/2020" data-delay="1" data-step="3" data-error="False"&gt;, Last Processed 2/5/2020&lt;/span&gt;&lt;/span&gt;
                  &lt;/p&gt;
              &lt;/div&gt;
  </code></pre>