title: Parsing table data from BeautifulSoup HTML Comment
body: <p>So I am trying to get a table off of <a href="https://www.baseball-reference.com/register/team.cgi?id=9995d2a1" rel="nofollow noreferrer">https://www.baseball-reference.com/register/team.cgi?id=9995d2a1</a>, specifically the one labeled &quot;Team Pitching&quot;, which is hidden in an html comment, preventing me from using pd.read_html() or another simpler method. I have gotten to the point where I have all of the data in a data frame, but my issue is that players with an asterisk in their name because they are left handed dissapear. Meaning their names turn to 'None', but I really need to remove the '*' so that the name reads.</p>
  <p>This is what I did to get what I have so far with the 'None' as a name for lefties:</p>
  <pre><code>page = BeautifulSoup(requests.get('https://www.baseball-reference.com/register/team.cgi?id=b0a9f9bc').text, features = 'lxml')
  
  tbls = []
  for comment in page.find_all(text=lambda text: isinstance(text, Comment)):
          if comment.find(&quot;&lt;table &quot;) &gt; 0:
              comment_soup = BeautifulSoup(comment, 'lxml')
              table = comment_soup.find(&quot;table&quot;)
              tbls.append(table)
  
  def parse_row(row):
    return [str(x.string) for x in row.find_all('td')]
  
  # pitching table
  pitching_tbl = tbls[0]
  
  # html text only used for finding names
  html = BeautifulSoup(pitching_tbl.text, features = 'lxml')
  
  rows = pitching_tbl.find_all('tr')
  data = pd.DataFrame([parse_row(row) for row in rows])
  </code></pre>
  <p>What I would like to be able to do is loop through the text within the pitching_tbl text, and change it in place if there is an asterisk and use .replace('*', ''), and have the actual html within pitching_tbl be changed.</p>
  <p><a href="https://i.stack.imgur.com/Mw1Wv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mw1Wv.png" alt="Output" /></a></p>
  <p>any help is appriciated!</p>