teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

コード修正

2018/03/30 01:50

投稿

8524ba23
8524ba23

スコア38352

answer CHANGED
@@ -14,12 +14,12 @@
14
14
  soup = BeautifulSoup(html,"lxml")
15
15
  d = soup.find('div',{'class':'race_otherdata'})
16
16
  for p in d.find_all('p'):
17
- t = p.text.replace(u'\xa0', '') # 「 」(NO-BREAK SPACE)=\xa0を除外
17
+ t = p.text.replace(u'\xa0', ',') # 「 」(NO-BREAK SPACE)=\xa0を分かりやすい区切り文字に置換
18
18
  print t
19
19
 
20
20
  """
21
- 4回中京1日目2歳
21
+ 4回中京1日目,2歳,
22
- 混[指定]16頭
22
+ 混[指定],16頭
23
23
  本賞金:500、200、130、75、50万円
24
24
  """
25
25
  ```