前提・実現したいこと
<div _ngcontent-uau-3 class="form"> ... </div>
class="form"の要素がいくつかあり、それを取得したい
発生している問題・エラーメッセージ
エラーメッセージはなく、printで出力すると要素が空([])になっている
該当のソースコード
python
11. 2elements = driver.find_elements_by_class_name('form') 3print(elements) 42. 5elements = driver.find_elements_by_xpath('//[@class="form"]') 6print(elements) 73. 8from selenium.webdriver.support.wait import WebDriverWait 9from selenium.webdriver.common.by import By 10from selenium.webdriver.support import expected_conditions as EC 11 12wait = WebDriverWait(driver, 10) 13wait.until(EC.presence_of_element_located((By.CLASS_NAME, 'form')))
試したこと
上記のソースコード
補足情報(FW/ツールのバージョンなど)
↓自分で調べる中で以下の記事を参考にしました
https://stackoverflow.com/questions/29503342/using-angular-jsprotractor-with-selenium-in-python
https://stackoverflow.com/questions/38789102/locating-elements-with-selenium-webdriver-and-angular
https://sqa.stackexchange.com/questions/24906/getting-correct-locator-for-an-angular-page-element
以上、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/14 01:45 編集