title: web scraping with beautifulsoup using python, saving to MySQL
body: <p>I am new to the programming, currently I am learning to do web scraping using python. Your answer or suggestion will be beneficial to my learning process.</p>
  <p><strong>Here is the part of HTML. I want to extract information including data, name and its usage.</strong></p>
  <pre><code>&lt;h2&gt;Jan. 2020&lt;/h2&gt;
  &lt;p&gt;&lt;strong&gt;nameA:&lt;/strong&gt;&amp;nbsp;usage for somethingA&lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;nameB:&lt;/strong&gt;&amp;nbsp;usage for somethingB&lt;/p&gt;
  
  &lt;h2&gt;Dec. 2019&lt;/h2&gt;
  &lt;p&gt;&lt;strong&gt;nameC:&lt;/strong&gt;&amp;nbsp;usage for somethingC&lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;nameD:&lt;/strong&gt;&amp;nbsp;usage for somethingD&lt;/p&gt;
  &lt;p&gt;&lt;strong&gt;nameE:&lt;/strong&gt;&amp;nbsp;usage for somethingE&lt;/p&gt;
  </code></pre>
  <p><strong>Here is my scraping code.</strong></p>
  <pre><code>from bs4 import BeautifulSoup
  import requests
  res=requests.get(&quot;https://website for my web scraping&quot;)
  soup=BeautifulSoup(res.text,&quot;html.parser&quot;)
  
  start = soup.find('h2', string = &quot;Jan. 2020&quot;)
  print (start.text)
  for elem in start.next_siblings:
       if elem.name == 'h2':
           break
       if elem.name != 'p':
           continue
       print(elem.text)
       
  start = soup.find('h2', string = &quot;Dec. 2019&quot;)
  print (start.text)
  for elem in start.next_siblings:
       if elem.name == 'h2':
           break
       if elem.name != 'p':
           continue
       print(elem.text)
  </code></pre>
  <p><strong>The code worked and here is the output.</strong></p>
  <pre><code>Jan. 2020
  nameA: usage for somethingA
  nameB: usage for somethingB
  Dec. 2019
  nameC: usage for somethingC
  nameD: usage for somethingD
  nameE: usage for somethingE
  </code></pre>
  <p>But my main goal is to generate a table below including date, name and usage and saving the data to MySQL. How do I accomplish this?</p>
  <pre><code>Date        Name    Usage
  Jan. 2020   nameA   somethingA
  Jan. 2020   nameB   somethingB
  Dec. 2019   nameC   somethingC
  Dec. 2019   nameD   somethingD
  Dec. 2019   nameE   somethingE
  </code></pre>
  <p>This website gets updated once a while and will have a new set of data (say March. 2020) added and an old set of data (say Nov. 2019) taken out.  How do I adjust the python code to reflect website change?</p>