Pythonを用いて、社内サイトの販売日に日付を自動入力することに取り組んでいます。
下記のような<input>があり、
HTML
1<body> 2 3<input fragment="85fa8d07" type="date" max="9999-12-31" class="form-control" style="flex-basis: content;"> 4 5<input fragment="85fa8d07" type="time" class="form-control" style="flex-basis: content;"> 6 7<body>
下記のように実行したところ、
入力欄に日付は入るのですが値が反映されず、困っています。
Python
1#日付日時指定 2driver.execute_script("document.querySelector('#css selecotr').value = '2022-02-01'") 3time.sleep(3) 4 5driver.execute_script("document.querySelector('#css selector').value = '00:00'") 6time.sleep(3) 7 8#検索ボタンクリック 9id_input=driver.find_element_by_xpath('#Xpath').click() 10time.sleep(3) 11
上記の画像のように日付は入力されるのですが、検索結果が日付反映されません。
例)2022/02/01~02/10と入力されているが、検索結果は反映されおらず、日付指定されていない販売確定分が抽出される。
Python
1id_input=driver.find_element_by_xpath('#Xpath') 2id_input.send_keys('2022-02-01')
上記も試しましたが、「element not interactable」とErrorが出ます。
ご指摘よろしくお願いいたします。
あなたの回答
tips
プレビュー