Date: Wed, 28 Sep 2005 09:25:53 +0100
From: Ed Singleton <[EMAIL PROTECTED]>
Subject: Re: [Tutor] find data in html file
To: tutor@python.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1

On 27/09/05, lmac <[EMAIL PROTECTED]> wrote:

>> Hi there,
>> i have a base-question. If i want to read some kind of data out of a line
>> which i know the start-tag and the end-tag in an html-file how do i
>> recognize
>> if it's more than one line ?
>>
>> Example:
>>
>> <td>Some text<a href>link</a>text ..... DATA ....</tr></td> etc.
>>
>> I would use >text as the starting tag to localize the beginning of the DATA.
>> And then </tr> as the ending tag of the DATA. But if there is \n then
>> there are more than
>> one line.
>  
>

Hopefully it's just a typo or something, but you appear to have your
ending </tr> and </td> tags the wrong way round.

You should be closing the cell before you close the row.

How do you want to get the data out?  This case is simple enough that
you could do a lazy (non-greedy) regex statement for it.  Something
like "<td>([\s|\S]+?)</td>" would do it.

Ed

It's not this simple. The whole thing is that i try to use ebay.de for fetching 
websites
when i give an articlenumber. The downloading of the site for a specific 
article is no problem.
But to get the data like price,bidders,shipment etc without the official 
eBayAPI is hard.
Maybe anyone has a solution made ?

Thanks anyway. I tried the htmllib. This is a very good lib but i don't get it 
to work cos
there is no <tag> thing for the data i want to get. This is for html-tags. And 
to store data
in my own XML-files. (what i am goint to do when i get the data).





_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to