スポンサーリンク

【Selenium】Permission denied to access property “handleEvent”と出たときにやったこと

以下のようなエラーが出た

[ ~]$ python selenium.py
Traceback (most recent call last):
File “selenium.py”, line 98, in <module>
scrayping(wd, args.target_month)
File “selenium.py”, line 41, in scrayping
element = wd.find_element_by_xpath(“//div[@id=’layout’]/div[2]/div/button”)
File “/略/anaconda3/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py”, line 354, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File “/略/anaconda3/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py”, line 832, in find_element
‘value’: value})[‘value’]
File “/home/略/anaconda3/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py”, line 297, in execute
self.error_handler.check_response(response)
File “/home/略/anaconda3/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py”, line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Permission denied to access property “handleEvent”
Stacktrace:
at ye</e.prototype._instrumentDOM/</</< (https://adnwif.d2c.ne.jp/js/app.bundle.js:1)

以下参考URL
http://ja.voidcc.com/question/p-wqvcnwim-kp.html
https://tutorialmore.com/questions-630505.htm
https://www.seleniumqref.com/api/python/element_get/Python_active_element.html

switch_to_active_element()

switch_to.active_element
を使えとあったので
switch_to_active_element()を使ってみる

するとエラーが出ずに処理も実行されたため解決

コメント

タイトルとURLをコピーしました