Setsu Yuki

Japanese things and life.

SeleniumをYosemite, Pythonで使ってみる。

環境

調べたサイト

PythonとSeleniumでネットバンキングをスクレイピングする | >> work.log Google検索とか、MUFGの明細取得とか。

os.path.dirnameの一個上にos.abspathがいると思う。

Selenium WebDriver — Selenium Documentation

SeleniumAPIが載っている。Pythonの使い方もある。

''' browser = webdriver.Chrome(DRIVER_PATH) # driverの用意 serach_input = browser.find_element_by_name('q') # qというエレメントを探す。 ''' find_element_by_nameで検索クエリのオブジェクトを取得したりしているが、 APIの説明によればこの関数は ''' <input name="cheese" type="text"/> ''' 的な要素を取り出せるらしい(HTMLタグを解釈されてしまった)。