ボールを蹴りたいシステムエンジニア

ボール蹴りが大好きなシステムエンジニア、ボールを蹴る時間確保の為に時間がある時には勉強する。

2016-08-31から1日間の記事一覧

【Python3】BeautifulSoupでscriptタグ除去

こんな感じで出来た。 body.getText()でタグ含むテキスト文字列を取得 soup = BeautifulSoup(open("hoge.html")) script = soup("script") for tag in script: tag.extract() body = soup.body text = body.getText() script全てをループするのであまり良く…