発生している問題
欄内には数字(「1」や「10」など)が入力されているものの、「ページのソースを表示」「検証」だとその数字が表示されません。
html
1<input type="text" class="form-control" name="time" id="time" placeholder="enter">
中にはvalueはあるものの、値が入っていないものもあります。
html
1<input type="text" class="form-control" name="time" id="time" value placeholder="enter">
これらをseleniumを使ってスクレイピングしたいのですが、方法がわからず困っています。
試したこと
python
1driver.find_element_by_xpath("//*[@id='time']").get_attribute('value') 2
こちらだとエラーで、
python
1test = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'time'))) 2test.driver.find_element_by_xpath("//*[@id='time']").text
こちらはエラーは出ないものの、何も取得できてませんでした。
バグなのか、そもそも取得できないものなのかわかりません。
よろしくお願い致します。
あなたの回答
tips
プレビュー