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 1077829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:38:04+00:00 2026-05-16T21:38:04+00:00

Hi I have Python String as shown below: <html><table border = 1><tr><td>JDICOM</td><td>Thu Sep 16

  • 0

Hi I have Python String as shown below:

<html><table border = 1><tr><td>JDICOM</td><td>Thu Sep 16 10:13:34 CDT 2010</td></tr></html>

From above string I am interested in two words

JDICOM
Thu Sep 16 10:13:34 CDT 2010

I tried find, findall, split but it did not help because of multiple regex.

I am quite new to python. If anyone knows please help.

  • 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-16T21:38:04+00:00Added an answer on May 16, 2026 at 9:38 pm

    Statutory Warning: don’t use regular expressions to parse (X)HTML. You are much better off using a parser such as BeautifulSoup.

    For e.g.

    >>> from BeautifulSoup import BeautifulSoup
    >>> html = """<html><table border = 1><tr><td>JDICOM</td><td>Thu Sep 16 10:13:34 CDT 2010</td></tr></html>"""
    >>> soup = BeautifulSoup(html)
    >>> for each in soup.findAll(name = 'td'):
     print each.contents[0]
    
    
    JDICOM
    Thu Sep 16 10:13:34 CDT 2010
    >>> 
    

    That said, here is a regular expression to do the same thing. Warning: this will stop working if the markup is irregular.

    >>> import re
    >>> pattern = re.compile('<td>(.*?)</td>', re.I | re.S)
    >>> for each in pattern.findall(html):
     print each
    
    
    JDICOM
    Thu Sep 16 10:13:34 CDT 2010
    >>> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have string stored in python variables, and i am outputting a html that
I have python code below that will loop through a table and print out
I have some code in a python string that contains extraneous empty lines. I
I have a string in Python 2.7.2 say u\u0638. When I write it to
I have a string in the format: 'nn.nnnnn' in Python, and I'd like to
I am using Python 2.7 . I have an alphanumeric string, on which I
I have a table created using Python + Sqlite3 c.execute('CREATE TABLE IF NOT EXISTS
I have gotten the HTML of a webpage using Python, and I now want
I am beginner to python Django . I have a string in json format
Does Python have a pool of all strings and are they (strings) singletons there?

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.