WebアプリケーションのUIテストを実行するのにSeleniumとSplinterを使用しています。ページのビューのランダムIDを生成しています。 。Python Selenium "WebDriverElement"オブジェクトに 'get_attribute'属性がありません
AttributeError: 'WebDriverElement' object has no attribute 'get_attribute'
私は "readthedocs見てきた:テストのためのIDここで
は、私が受けていますエラー、私は
from selenium import webdriver
from splinter import Browser
executable_path = {'executable_path':'./chromedriver.exe'}
browser = Browser('chrome', **executable_path)
data_view_id = browser.find_by_xpath('//ul[@class="nav"]').find_by_xpath('.//a[@href="#"]')[0].get_attribute("data-view-id")
# I am trying to get the id for the first item in the nav list and use it elsewhere
print(data_view_id)
この
を使用していたコードです'ページには' get_attribute 'という値があります。 WebDriverElementsに関するドキュメントが見つかりません。代わりにWebElementにアクセスするためのヘルプが必要です