Python Seleniumでブラウザの自動操作 6  JPX(証券取引所)の業種別価格情報を取得 27 Stock Price by Sector

ブラウザ操作

Python Seleniumによるブラウザ操作の紹介です。
ヒストリカルデータ取得の日付指定に、スライダーを自動操作しています。
【1】スライダーを移動させる量を求める
【2】ActionChainsで連続操作

y_slider = slider.location[“y”]
y_arrow = arrow.location[“y”]

actions = ActionChains(driver)
actions.move_to_element(slider)
actions.click_and_hold(slider)
actions.move_by_offset( 0, y_arrow – y_slider )
actions.perform()

00:00 Start
00:45 デモ動画Start
02:05 【付録】Seleniumコマンド

#Python #ブラウザ #自動操作 #Selenium #pandas #Windows #Anaconda #JPX #Stock #Sector

コメント

タイトルとURLをコピーしました