Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pythonでスクレイピングしてみた

alek-3
January 16, 2018

 Pythonでスクレイピングしてみた

2018年1月16日(火)

Python入門者の集い #6
~Python入門者向けLT大会&交流会~
https://python-nyumon.connpass.com/event/71516/
にて

alek-3

January 16, 2018
Tweet

Other Decks in Programming

Transcript

  1. 改善前 # 対戦番号の1位~4位のプレーヤー名の idを作成する。 id_first = '#rptMain_ctl' + str_count +

    '_lblPLAYER1' id_second = '#rptMain_ctl' + str_count + '_lblPLAYER2' id_third = '#rptMain_ctl' + str_count + '_lblPLAYER3' id_fourth = '#rptMain_ctl' + str_count + '_lblPLAYER4' # 対戦番号の1位~4位のプレーヤー名を抽出する。 text_first = soup.select(id_first)[0].getText() text_second = soup.select(id_second)[0].getText() text_third = soup.select(id_third)[0].getText() text_fourth = soup.select(id_fourth)[0].getText()