dimanche 25 décembre 2016

How can i separately crawl this code?

I have been developing a web-crawler using python 3.6 at this moment, and just got a trouble with this code. I need to separately collect the text data from each "dd". I can tell first "dd" by using "class_=first" code. But I am confused with how to separately collect the second "dd" and third "dd" without "class".

Also, I would like to collect the text data from the second "dd" separately(e.g. 2012 | April).

Please give me some advice.

Thanks.

(Code)

<dd class="first">
    <span class="t">Plate Number</span>
    <span class="s">43-3180</span>
</dd>
<dd>
    <span class="t">Year</span> 
    <span class="s"><em class="red">2012&nbsp;Apr.</em></span>
</dd>
<dd>
    <span class="t">Mileage</span>
    <span class="s"><em class="red">60,000 km</em></span>
</dd>




Aucun commentaire:

Enregistrer un commentaire