Selenium webdriverとpythonを使用して自動化しようとすると、次の問題に直面しています。
単純なクリックはアクションチェーンなしで動作します。
element.click()
しかし、アクションチェーンクラスを使用してクリックしようとしていません:
from selenium.webdriver.common.action_chains import ActionChains
action = ActionChains(driver)
action.click(element).perform()
同様に、ドラッグをドラッグしようとすると、アクションチェーンを使用して動作しませんクラス:
action.drag_drop_by_offset(element,"0","100").perform()
action.drag_drop(element,element2).perform()
ActionChainsを使用すると、古い要素の例外が発生します。
Is there any other way to perform these operations like move_to,
mouse_press, mouse_release, drag_drop etc. without
ActionChains class
さらに、 driver
コマンドで直接作業する:
from selenium.webdriver.remote.command import Command
driver.execute(Command.CLICK_ELEMENT, {"id":getattr(element,"id")})
しかし、これはしません:
from selenium.webdriver.remote.command import Command
driver.execute(Command.MOVE_TO, {"id":getattr(element,"id")})
driver.execute(Command.MOUSE_DOWN, {})
driver.execute(Command.MOVE_TO, {"id":getattr(element2,"id")})
driver.execute(Command.MOUSE_UP, {})
助言がありますか?
ベストアンサー
申し訳ありませんが、適切な答えはありません