0
私はちょうど$から価格データを抽出したいと思います。ファイルには複数の価格があり、class = "price price-label">の後に来るものだけが必要です>Pythonフィルタの問題で再投稿
私は完全なコードを貼り付けました - 私は午前情報フォームを引っ張ってください。file.txt - 私の希望する出力は、名前と価格を並べて表示することです。私は前に美しいスープを使っていません。
data-default-alt="Ford Truck"> </h3> </a> </div> <div class="tileInfo"> <div class="swatchesBox--empty"></div> <div class="promo-msg-text"> <span class="calloutMsg-promo-msg-text"></span> </div> <div class="pricecontainer" data-pricetype="Stand Alone"> <p id="price_206019013" class="price price-label "> $1,000.00 </p>
マイコード
with open("targetbubbles.txt") as str:
st = str.read()
#print st
import re
#brand=re.search('data-default-title=\"(.*?)" ',st)
#cost=re.search('\$(\d+,?\d*\.\d+)</p>',st)
私はあなたがこのためにXMLパーサのいくつかの種類を使用している願って、この種のに役立つモジュールのですか?あなたのコードを示してください。 – idjaw