0
Webページを開いたり、ドロップダウンリストからオプションを選択したり、Seleniumを使わずにいくつかのクリックをする必要があります。 Pythonに内蔵ライブラリがありますか?私はこれを手助けすることができますか?PythonでSeleniumを使用しないでWebページのドロップダウンメニューを選択する
Webページを開いたり、ドロップダウンリストからオプションを選択したり、Seleniumを使わずにいくつかのクリックをする必要があります。 Pythonに内蔵ライブラリがありますか?私はこれを手助けすることができますか?PythonでSeleniumを使用しないでWebページのドロップダウンメニューを選択する
は、あなたがこれはそれを使用してブラウザ対話の簡単な例である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.io'):
print("Yes, the official website was found!")
else:
print("No, it wasn't found... We need to improve our SEO techniques")