Extract Information from Tables in html | Bytes (2024)

Home Posts Topics Members FAQ

Jackie Wang

Dear all,

Here is a html code:

<td valign="top" headers="col4">

Premier Community Bank of Southwest Florida
<br />
Fort Myers, FL

</td>

My question is how I can extract the strings and get the results:
Premier Community Bank of Southwest Florida; Fort Myers, FL

Thanks a lot

Jackie

Sep 5 '08 #1

Subscribe Reply

1 Extract Information from Tables in html | Bytes (1) 1496 Extract Information from Tables in html | Bytes (2)

Stefan Behnel

Hi,

Jackie Wang wrote:

Here is a html code:

<td valign="top" headers="col4">

Premier Community Bank of Southwest Florida
<br />
Fort Myers, FL

</td>

My question is how I can extract the strings and get the results:
Premier Community Bank of Southwest Florida; Fort Myers, FL

Use lxml.html. Something like this should do what you want:

>>from lxml import html
tree = html.parse("htt p://server.org/thefile.html")
all_tds = tree.findall("//td")
for td in all_tds:

... print( td.xpath("norma lize-space()") )

Tweak as you see fit, tree iteration is at your service in case you need more.

http://codespeak.net/lxml/

Stefan

Sep 5 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8 1727

Extract information from various web sites

by: john |last post by:

I would like to develope a system using a web or non-web based client (FrontPage, Access, etc.) that can send requests to various travel web site (using our user name and password for each) and extract the requested pricing and information and compile it together for comparison. Can anyone suggest the best way to do this? I assumed XML would...

Microsoft Access / VBA

1608

Any way to extract certain bytes from the remote file?

by: Vjay77 |last post by:

I posted this question, but I pressed 'post' and it disappeared. So once again: Problem: I need to go to lets say www.site.com/page.html Imagine that this html code is 6 mb long. I need to extract information between bytes 5000 and 5020.

Visual Basic .NET

3 2448

Need to extract portion of HTML page...

by: rahman |last post by:

I have few hundred HTML pages. I need to extract portion of each HTML page into a text/database/HTML files format. You can imagine it is very tedious to do one by one. Is there any automatic process/software/tool available that could help me extract information form mass HTML files? I can specify what portion of file to take or leave. I...

HTML / CSS

9 3488

Extract links from Javascript (not using Javascript)?

by: chrisspencer02 |last post by:

I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one tailored to a particular page/script. Hopefully, the problem can be solved without recreating a complete Javascript interpreter. Any ideas?

Javascript

2 12181

Extract Content Between Style Tags with Preg and PHP

by: ameshkin |last post by:

This script I wrote works with tables, td's and div's, but not with style tags. Can anyone figure out the regular expression for finding <styletags. The trick is that sometimes its not just <style Its <style type="text/css"> Basically, i want to take the information in between the style content from any url <?php

PHP

1 2507

How to extract definition of nicknames in DB2 version 7

by: Prasad |last post by:

Hi, We have DB2 version 7 fixpak 14 on AIX 5.1. We have nicknames to another RDBMS tables. These nicknames have views and specification only indexes. I would like to know how we can extract the definition of these nicknames and related objects. db2look does not seem to have any option to extract this information. I tried the command...

DB2 Database

2 2636

Information Regarding $_Session and Extract

by: kimi |last post by:

Hi ppl, I am new to PHP. I would need some information on the following: 1. a) I wanted to know from where the data is extracted and stroed in the global assocoative arrays ( specifically what will be the contents of $_Session ?) b) Is there any way by which i can get to know all the keys of the arrays ( specifically what are the Keys...

PHP

7 1735

Using keyes stored in one table to extract data from others

by: aktar |last post by:

I have two related tables: 1) personal_details 2) company_details both having "ID" as a primary key I also have another table called mail. The mail table contains: MailID primary key

MySQL Database

1 1613

Re: Extract Information from Tables in html

by: Walter Cruz |last post by:

On Fri, Sep 5, 2008 at 11:29 AM, Jackie Wang <jackie.python@gmail.comwrote: Use BeautifulSoup. 's - Walter

Python

7502

What is ONU?

by: marktang |last post by:

ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...

General

7434

Changing the language in Windows 10

by: Hystou |last post by:

Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...

Windows Server

7692

Problem With Comparison Operator <=> in G++

by: Oralloy |last post by:

Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...

C / C++

7946

Maximizing Business Potential: The Nexus of Website Design and Digital Marketing

by: jinu1996 |last post by:

In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...

Online Marketing

7791

Discussion: How does Zigbee compare with other wireless protocols in smart home applications?

by: tracyyun |last post by:

Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...

General

6026

AI Job Threat for Devs

by: agi2029 |last post by:

Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...

Career Advice

3470

Windows Forms - .Net 8.0

by: adsilva |last post by:

A Windows Forms form does not have the event Unload, like VB6. What one acts like?

Visual Basic .NET

1 1045

How to add payments to a PHP MySQL app.

by: muto222 |last post by:

How can i add a mobile payment intergratation into php mysql website.

PHP

744

Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy

by: bsmnconsultancy |last post by:

In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

General

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisem*nts and analytics tracking please visit the page.

Extract Information from Tables in html | Bytes (2024)

References

Top Articles
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 6092

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.