473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need help getting BeautifulSoup contents


The trick to this one is that the html looks something like this:

<td width="100%" colspan="2">
american,
a href="/browse/blue" linkindex="12" set="yes">blue brick churn cottage
cream "

My question is I want everything inside, the contents of each ad the
regular text of the <td>.
I know I can do like a.contents, but it only gives me the first one, in this
case being "blue". I want the contents of each of those and the regular
contents of the <td>.

P.S. notice the things inbetween the <a tags, I need those too :(

Can anyone help?

--
View this message in context: http://www.nabble.com/Need-help-gett...p18501881.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Jul 17 '08 #1
1 2195
I dont quite understand what u want. U should paste the html here
http://pastebin.com/ also provide the result that u want.

If u dont take the time to write what u wont, nobody will take the
time to help u

On Jul 17, 7:38*am, Alexnb <alexnbr...@gmail.comwrote:
The trick to this one is that the html looks something like this:

<td width="100%" colspan="2">
american,
a href="/browse/blue" linkindex="12" set="yes">blue brick churn cottage
cream "

My question is I want everything inside, the contents of each * ad the
regular text of the <td>.
I know I can do like a.contents, but it only gives me the first one, in this
case being "blue". I want the contents of each of those and the regular
contents of the <td>.

P.S. notice the things inbetween the <a tags, I need those too :(

Can anyone help?

--
View this message in context:http://www.nabble.com/Need-help-gett...ontents-tp1850...
Sent from the Python - python-list mailing list archive at Nabble.com.
Jul 17 '08 #2

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

Similar topics

7
by: Gonzillaaa | last post by:
I'm trying to get the data on the "Central London Property Price Guide" box at the left hand side of this page http://www.findaproperty.com/regi0018.html I have managed to get the data :) but...
3
by: GinTon | last post by:
I'm trying to get the 'FOO' string but the problem is that inner 'P' tag there is another tag, 'a'. So: <p class="contentBody">FOO <a name="f"></a</p> So if I run 'print...
1
by: CSUIDL PROGRAMMEr | last post by:
folks, I am trying to write a script that would open a download server and download all the files and store them in a list for example Download server is...
9
by: Mizipzor | last post by:
Is there a way to "subscribe" to individual topics? im currently getting bombarded with daily digests and i wish to only receive a mail when there is activity in a topic that interests me. Can this...
3
by: John Nagle | last post by:
Are weak refs slower than strong refs? I've been considering making the "parent" links in BeautifulSoup into weak refs, so the trees will release immediately when they're no longer needed. In...
5
by: Larry Bates | last post by:
Info: Python version: ActivePython 2.5.1.1 Platform: Windows I wanted to install BeautifulSoup today for a small project and decided to use easy_install. I can install other packages just...
2
by: Alexnb | last post by:
Okay, I am not sure if there is a better way of doing this than findAll() but that is how I am doing it right now. I am making an app that screen scapes dictionary.com for definitions. However, I...
1
by: Alexnb | last post by:
Okay, what I want to do with this code is to got to thesaurus.reference.com and then search for a word and get the syns for it. Now, I can get the syns, but they are still in html form and some are...
0
by: Alexnb | last post by:
The trick to this one is that the html looks something like this: <td width="100%" colspan="2"> american, a href="/browse/blue" linkindex="12" set="yes">blue brick churn cottage cream " My...
2
by: academicedgar | last post by:
Hi I would appreciate some help. I am trying to learn Python and want to use BeautifulSoup to pull some data from tables. I was really psyched earlier tonight when I discovered that I could do...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.