[Tutor] BeautifulSoup - getting cells without new line characters

jonasmg at softhome.net jonasmg at softhome.net
Sat Apr 1 19:39:21 CEST 2006


Kent Johnson writes: 

> jonasmg at softhome.net wrote:
>> Yes, ok. But so, it is only possible get data from a row (rows[0])  
>> 
>> cells=rows[0]('td')  
>> 
>> And I want get data from all rows. I have trying with several 'for' setences 
>> but i can not. 
> 
> Can you show us what you tried? 
> 
> Have you read a Python tutorial? It seems like some of the things you 
> are struggling with might be addressed in general Python material. 
> 
> Kent 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
 

You consider a thing about me.
If I ask something it is because I cannot find the solution. I do not it by 
whim. 

Yes, I have read tutorials about python, and I have looked for this problem 
in this mail list using a web searcher as alltheweb, and I have even looked 
for in the google groups about python. 

* for rows in table('tr'): print rows('td') 

it fails when i'm going to get data of each cell using:
for rows in table('tr'): print rows('td')[0] 

* for rows in table('tr'):
   for cell in rows('td'):
      print cell 

The same, using print cell[0] 


More information about the Tutor mailing list