title: Python Flask: Return HTML Content
body: <p>i am trying to put together a makeshift tool for my own personal use, im not experienced with backend development at all. so my methods may be unconventional. although there may be a much better method to go about this</p>
  
  <p>consider the following snippet from my html file:</p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;
      &lt;button id="socks.shirt.pants"&gt; dummy text here &lt;/button&gt;
  &lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>my goal, as simply as i can put it, is to click BUTTON and return the string text within the ID attribute in python using Flask. Below is the code i am working with.</p>
  
  <pre><code>app = Flask(__name__)
  @app.route('/', methods=['GET', 'POST'])
  def index():
      #display html file
      return send_from_directory('','myfile.html')
      #this is the part that needs help
      textdata = request.htmlcontent.td.id
  </code></pre>
  
  <p>i have tried several different ways to extract the html content. including but not limited to:</p>
  
  <pre><code>request.html.tr.id,
  request.get_data(),
  request.data(),
  request.form,
  </code></pre>
  
  <p>i understand now that request.form returns user-supplied information submitted in a form, which wont work for me because the information that i want to retrieve will be hardcoded into the html file under whichever tag that would allow this process to work. (currently tr -> td -> button).
  the other methods either returned None or an some empty string, i believe.</p>
  
  <p>also, i am wondering if maybe there is some piece of javascript code that ill need to use in addition to Flask as well? i hope that this is not an unrealistic expectation to ask this question! any suggestions would help greatly!</p>