このコードを使用して、splinter のクリック ボタン オプションを確認しました。
from splinter import Browser
with Browser() as browser:
# Visit URL
url = "http://www.google.com"
browser.visit(url)
browser.fill('q', 'splinter - python acceptance testing for web applications')
# Find and click the 'search' button
button = browser.find_by_name('btnG')
# Interact with elements
button.click()
if browser.is_text_present('splinter.readthedocs.org'):
print("Yes, the official website was found!")
else:
print("No, it wasn't found... We need to improve our SEO techniques")
そして私は例外を得ました:要素は現在表示されていないため、相互作用しない可能性があります。ブラウザを待つことは解決策ではありません(スリープメソッドを長時間作成してもまだ機能しないため)。これはhttps://splinter.readthedocs.org/en/latest/#sample-codeに示されているサンプルコードですが、私にとってはうまくいきません