title: How to select information within a HTML tag to use in a flask form
body: <p><strong>My question:</strong> </p>
  
  <p>Is there a way that I can select the artist name from between the <code>h4</code> tags and pass it into the database using Flask?</p>
  
  <p><strong>Context:</strong></p>
  
  <p>I am new to flask so I could be making some pretty simple mistakes here. I am trying to allow a user to click a button to 'follow/like' an artist and when they do this the artists name will be added to a basic database along with the users ID. To do this I am trying to use <code>request.form.get('artistName')</code>. However, each time this does not return anything. </p>
  
  <p><strong>The HTML for my code looks like:</strong></p>
  
  <pre><code>{% for i in range(numOfResults) %}
       &lt;form method="POST" action="/follow"&gt;
           &lt;div class="col-xs-6 col-sm-3 placeholder"&gt;
               &lt;img src="{{artistImage[i]}}" width="200" height="200" class="img-responsive" alt="Missing Artist Image"&gt;
               &lt;h4 name='artistName'&gt;{{ artistName[i] }}&lt;/h4&gt;
               &lt;button type="submit"&gt;Follow Artist&lt;/button&gt;
            &lt;/div&gt;
        &lt;/form&gt;
  {% endfor %}
  </code></pre>
  
  <p><strong>My app.py looks as follows:</strong></p>
  
  <pre><code>@app.route('/follow', methods=['GET', 'POST'])
  def follow():
      artistName = request.form.get('artistName')
      new_like = Like(user_id=current_user.id, artist=artistName, artist_id='10')
      db.session.add(new_like)
      db.session.commit()
      return '&lt;h1&gt; Artist Followed &lt;/h1&gt;'
  
  </code></pre>