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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:43:54+00:00 2026-05-25T09:43:54+00:00

I have to extract an information from the following web page with Python 3:

  • 0

I have to extract an information from the following web page with Python 3: http://www.homefinance.nl/english/international-interest-rates/libor/libor-interest-rates-gbp.asp

The download using urllib.request seems ok, but surprisingly, when I parse the html file with my HTMLParser class the parsing seems to stop in the middle of the meta tags, without giving any rationales.

This is my code:

import urllib.request
from html.parser import HTMLParser

def downloadLIBOR():
    html_file = urllib.request.urlopen("http://www.homefinance.nl/english/international-interest-rates/libor/libor-interest-rates-gbp.asp")
    return html_file

class tmpHTMLParser(HTMLParser):

    def __init__(self):
        self._libor = "0.81625 %"
        self._stack = []
        self._properStack = []
        super().__init__()

    def handle_starttag(self, tag, attrs):
        print("starttag " + str(tag))
        print(self.get_starttag_text())
        self._stack.append(tag)

    def handle_startendtag(self, tag, attrs):
        print("startendtag")

    def unknown_decl(self, data):
        print("unknown_decl")

    def handle_endtag(self, tag):
        print("endtag " + str(tag))
        self._stack.pop()

def _buildProperStack(webpage):
    """dev tool: return the stack leading to the libor rate libor into the webpage webpage."""
    parser = tmpHTMLParser()
    parser.feed(webpage)

if __name__ == "__main__":
    webpage = downloadLIBOR()
    print("download done")
    html = str(webpage.read())
    _buildProperStack(html)
    exit(0)
  • 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-25T09:43:55+00:00Added an answer on May 25, 2026 at 9:43 am

    BTW, I noticed that you forgot to do a parser.close() after the parser.feed(). It might be buffering something, and the close will force it to finish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a few Python tools in the past to extract data from
Let's say I have a web page ( /index.html ) that contains the following
How can I extract information from a binary file that I don't have the
I have the following String and I want to extract the 383-0408 from it,
My problem is :: From a string like /usr/folder1/folder2/filename.ext I have to extract out
I have a requirement to extract a distinct subset of rows from a DataTable,
I have a PHP web application on an intranet that can extract the IP
I have barcode images in jpg format and want to extract barcode # from
I have the following snippet where I would like to extract code between the
I have a string from which I wish to extract a single word, but

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.