Python+Selenium で JavaScriptで記述されたボタンをクリックできない。
あるフィットネスサイトをSeleniumで自動予約しようとしています。
レッスンの座席を指定するところまで遷移できましたが、座席がJavaScriptで記述されており、クリックできない状態となり、行き詰っております。
座席は、Excelの表形式の形で表示されており、1~50まで座が表示されています。
空きの席の有無判定し、空き席をクリックして予約したいのですが、JavaScriptで記述されており、HTMLのタグを利用したスクレイピングでは歯が立ちません。
以下が座席のデータで、座席番号(1~50)、画面上の座標軸(X、Y)、空きの有無(reserved/enable)が確認できます。
しかしながら、HTMLではないため、Seleniumでは操作できません。
RsvApp.mapData = {"x":"9","y":"6","label":{"format":"{$NUM}","x":"number","y":"number"},"data":[{"num":1,"y":0,"x":0,"status":"reserved"},{"num":2,"y":0,"x":1,"status":"reserved"},{"num":3,"y":0,"x":2,"status":"reserved"},{"num":4,"y":0,"x":3,"status":"reserved"},{"num":5,"y":0,"x":4,"status":"reserved"},{"num":6,"y":0,"x":5,"status":"reserved"},{"num":7,"y":0,"x":6,"status":"reserved"},{"num":8,"y":0,"x":7,"status":"reserved"},{"num":-1,"y":0,"x":8,"status":"hidden"},{"num":9,"y":1,"x":0,"status":"reserved"},{"num":10,"y":1,"x":1,"status":"reserved"},{"num":11,"y":1,"x":2,"status":"reserved"},{"num":12,"y":1,"x":3,"status":"reserved"},{"num":13,"y":1,"x":4,"status":"enable"},{"num":14,"y":1,"x":5,"status":"reserved"},{"num":15,"y":1,"x":6,"status":"enable"},{"num":16,"y":1,"x":7,"status":"reserved"},{"num":17,"y":1,"x":8,"status":"reserved"},{"num":18,"y":2,"x":0,"status":"reserved"},{"num":19,"y":2,"x":1,"status":"reserved"},{"num":20,"y":2,"x":2,"status":"reserved"},{"num":21,"y":2,"x":3,"status":"reserved"},{"num":22,"y":2,"x":4,"status":"reserved"},{"num":23,"y":2,"x":5,"status":"enable"},{"num":24,"y":2,"x":6,"status":"reserved"},{"num":25,"y":2,"x":7,"status":"reserved"},{"num":-1,"y":2,"x":8,"status":"hidden"},{"num":26,"y":3,"x":0,"status":"reserved"},{"num":27,"y":3,"x":1,"status":"reserved"},{"num":28,"y":3,"x":2,"status":"reserved"},{"num":29,"y":3,"x":3,"status":"reserved"},{"num":30,"y":3,"x":4,"status":"reserved"},{"num":31,"y":3,"x":5,"status":"reserved"},{"num":32,"y":3,"x":6,"status":"reserved"},{"num":33,"y":3,"x":7,"status":"reserved"},{"num":34,"y":3,"x":8,"status":"reserved"},{"num":35,"y":4,"x":0,"status":"reserved"},{"num":36,"y":4,"x":1,"status":"reserved"},{"num":37,"y":4,"x":2,"status":"reserved"},{"num":38,"y":4,"x":3,"status":"reserved"},{"num":39,"y":4,"x":4,"status":"reserved"},{"num":40,"y":4,"x":5,"status":"reserved"},{"num":41,"y":4,"x":6,"status":"reserved"},{"num":42,"y":4,"x":7,"status":"reserved"},{"num":-1,"y":4,"x":8,"status":"hidden"},{"num":43,"y":5,"x":0,"status":"reserved"},{"num":44,"y":5,"x":1,"status":"reserved"},{"num":45,"y":5,"x":2,"status":"reserved"},{"num":46,"y":5,"x":3,"status":"reserved"},{"num":47,"y":5,"x":4,"status":"reserved"},{"num":48,"y":5,"x":5,"status":"reserved"},{"num":49,"y":5,"x":6,"status":"reserved"},{"num":50,"y":5,"x":7,"status":"reserved"},{"num":-1,"y":5,"x":8,"status":"hidden"}]};
どなたか対処方法のお知恵を拝借できないでしょうか。
HTMLを抜粋して添付致します。
宜しくお願い致します。