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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:31:19+00:00 2026-05-25T18:31:19+00:00

Im trying to build a html table that only contains the table header and

  • 0

Im trying to build a html table that only contains the table header and the row that is relevant to me. The site I’m using is http://wolk.vlan77.be/~gerben.

I’m trying to get the the table header and my the table entry so I do not have to look each time for my own name.

What I want to do :

  • get the html page
  • Parse it to get the header of the table
  • Parse it to get the line with table tags relevant to me (so the table row containing lucas)
  • Build a html page that shows the header and table entry relevant to me

What I am doing now :

  • get the header with beautifulsoup first
  • get my entry
  • add both to an array
  • pass this array to a method that generates a string that can be printed as html page

    def downloadURL(self):
    global input
    filehandle = self.urllib.urlopen(‘http://wolk.vlan77.be/~gerben’)
    input = ”
    for line in filehandle.readlines():
    input += line
    filehandle.close()

    def soupParserToTable(self,input):
        global header
    
        soup = self.BeautifulSoup(input)
        header = soup.first('tr')
        tableInput='0'
    
        table = soup.findAll('tr')
        for line in table:
            print line
            print '\n \n'
            if '''lucas''' in line:
                print 'true'
            else:
                print 'false'
            print '\n \n **************** \n \n'
    

I want to get the line from the html file that contains lucas, however when I run it like this I get this in my output :

 **************** 


<tr><td>lucas.vlan77.be</td> <td><span style="color:green;font-weight:bold">V</span></td> <td><span style="color:green;font-weight:bold">V</span></td> <td><span style="color:green;font-weight:bold">V</span></td> </tr>



false

Now I don’t get why it doesn’t match, the string lucas is clearly in there :/ ?

  • 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-25T18:31:19+00:00Added an answer on May 25, 2026 at 6:31 pm

    It looks like you’re over-complicating this.

    Here’s a simpler version…

    >>> import BeautifulSoup
    >>> import urllib2
    >>> html = urllib2.urlopen('http://wolk.vlan77.be/~gerben')
    >>> soup = BeautifulSoup.BeautifulSoup(html)
    >>> print soup.find('td', text=lambda data: data.string and 'lucas' in data.string)
    lucas.vlan77.be
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build this very simple (visually speaking) layout using HTML/CSS that
I'm trying to build some JavaScript in MooTools that fetches table row markup from
I'm trying to build a simple HTML table form that displays values from a
I am trying to build a simple nested html menu using HAML and am
I'm trying to build a blog/messageboard that uses static HTML files to serve content.
Im trying to build call to action button on my site using jQuery. I
I'm trying to build a CSS-based table that will be populated with information coming
I build dynamically my HTML table from database like that: for (i = 0;
When trying to pass a table built with HTML in my servlet like that:
I'm trying to build http://chitchat.at.infoseek.co.jp/vmware/vfd.html (VS 2008, Windows Server 2008 x64) however I'm getting

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.