次のスクリプトを実行してthisウェブサイトにアクセスし、csvをエクスポートするリンクをクリックしようとしています。Pythonでボタンスクリプトをクリック
from selenium import webdriver
driver=webdriver.Firefox()
driver.get("https://www.draftkings.com/contest/gamecenter/46877680")
elem1 = driver.find_element_by_link_text("Export Lineups to CSV")
elem1.click()
次のエラーが発生し、geckodriver
が見つかりません。私はセレンをインストールpip。私は古いビデオからこれを得て、現在はPython 3.6
を実行しているので、おそらく問題の一部でもあります。どこが間違っていますか?上記の例外の取り扱い中
Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Program Files\Python36\lib\subprocess.py", line 707, in init restore_signals, start_new_session) File "C:\Program Files\Python36\lib\subprocess.py", line 992, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified
、別の例外が発生しました:
Traceback (most recent call last): File "C:/Users/mike/Desktop/Lineup1.py", line 2, in driver=webdriver.Firefox() File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 144, in init self.service.start() File "C:\Program Files\Python36\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
あなたが理解していないエラーメッセージが表示されたときにまず行うべきことは、Googleにそれを行うことです。それは、一般的に、少なくともあなたが始めることができる答えを見つけるでしょう。 – JeffC
これは、私がオーバーフロージェフをスタックする方法です。 –