【目的】VS codeでpython を動かせる環境を作って頂きたい。
【依頼背景】
PC乗り換え後、vs codeでpythonが上手く作動せず困っています。具体的にはjupitarをインストールする際にpipが使えない(pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.)というエラーを吐きます。大体のサイトが
1.homebrewのインストール、path設定
2.pyenvのインストール、path設定
3.pythonのインストール、path設定
という流れですが、2のインストールまでは上手くいくのですがpath設定をするとなぜかpyenvとhomebrewを認識しなくなります。仕方ないのでpyenvはpathを設定せずにその後の設定を行いましたがこれが原因な気がします。
「pathを通す」については調べてもよくわからないのでぜひ解説お願いします。
pythonでselenium使用時に以下エラーが出て処理が止まるため回避方法を教えてください。
==========
selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of [object String] "{\"element-6066-11e4-a52e-4f735466cecf\":\"86116ad5-45ff-4293-9037-88dacaf91578\"}" is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5
StaleElementReferenceError@chrome://remote/content/shared/webdriver/Errors.jsm:464:5
element.resolveElement@chrome://remote/content/marionette/element.js:681:11
evaluate.fromJSON@chrome://remote/content/marionette/evaluate.js:254:26
evaluate.fromJSON@chrome://remote/content/marionette/evaluate.js:262:29
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:79:29
==========
プログラムの動作は以下になります。
使用driver :Firefox
エラーで止まる箇所:
ページ内のボタンを下記ループですべて押そうとしているときに処理の途中で止まります。
全てのページで止まるわけではなく、たまに止まってしまう状態です。
elemes = driver.find_elements_by_css_selector('span:nth-child(2) > input')
for elem in elemes:
elem.click()
ソース全文が必要な場合は、取引時に公開させていただきます。