0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Python】画面外の要素をクリックする方法

Last updated at Posted at 2024-02-07

◆問題
XPATHなどで指定し「.click()」でクリックしようとすると、できないことがあった。

◆対処法
「execute_script」を使用したらできた。

before.py
driver.find_element(By.XPATH, ***).click()
after.py
click_element = driver.find_element(By.XPATH, ***)
driver.execute_script("arguments[0].click();", click_element)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?