Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6141161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:12:43+00:00 2026-05-23T18:12:43+00:00

<html> <table border=1px> <tr> <td>yes</td> <td>no</td> </tr> </table> </html> Is there any way to

  • 0
<html> 
<table border="1px"> 
<tr>
<td>yes</td>
<td>no</td>
</tr>
</table>
</html>

Is there any way to get the contents of the table (yes ,no) besides beautifulsoup??

A python beginner,any help or any kind of direction will be of great help.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:12:43+00:00Added an answer on May 23, 2026 at 6:12 pm

    You can use the HTMLParser module that comes with the Python standard library.

    >>> import HTMLParser
    >>> data = '''
    ... <html> 
    ... <table border="1px"> 
    ... <tr>
    ... <td>yes</td>
    ... <td>no</td>
    ... </tr>
    ... </table>
    ... </html>
    ... '''
    >>> class TableParser(HTMLParser.HTMLParser):
    ...     def __init__(self):
    ...         HTMLParser.HTMLParser.__init__(self)
    ...         self.in_td = False
    ...     
    ...     def handle_starttag(self, tag, attrs):
    ...         if tag == 'td':
    ...             self.in_td = True
    ...     
    ...     def handle_data(self, data):
    ...         if self.in_td:
    ...             print data
    ...     
    ...     def handle_endtag(self, tag):
    ...         self.in_td = False
    ... 
    >>> p = TableParser()
    >>> p.feed(data)
    yes
    no
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CSS table tr {border-bottom:1px solid #008999} HTML <table width=100% cellspacing=0 cellpadding=0> <thead> <tr> <th
<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd> <html> <head> <style> table {border: 1px solid
I want to create a html table with a 1pt black outer border and
I have an html table <table border=0 width=100%> <tr class=headerbg> <th width=5%> No </th>
I have a HTML table like this: <table border=1> <tbody> <tr> <td><a href=# class=delete>DELETE
Border ALL the things! I'm writing a HTML table and I'm getting extremely strange
I have the following : <table style=border:solid 1px; border-color:black> <thead style=border:solid 2px; border-color:black> <tr>
I created an HTML table and used the following CSS to style the border
I have the following HTML table: <table style=width: 100%;> <tr> <td class=title_bar_left_border></td> <td class=title_bar_middle></td>
How do I alternate HTML table row colors using JSP? My CSS looks something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.