以下のウェブサイトから国情報をスクレイピングしようとして
'Country'
い
ますExposure
。 . セクションの下部にある矢印を使用してページ。私が試したことは何もないようです。Pythonでセレンを使用してそれを行う方法はありますか?
どうもありがとう!
使用したコードは次のとおりです。
urlpage = 'https://www.morningstar.com/etfs/xnas/vnqi/portfolio'
driver = webdriver.Chrome(options=options, executable_path='D:\Python\Python38\chromedriver.exe')
driver.get(urlpage)
elements=WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, "//a[text()='Country']")))
for elem in elements:
elem.click()
これはエラーメッセージです:
TimeoutException
Traceback (most recent call last)
<ipython-input-3-bf16ea3f65c0> in <module>
23 driver = webdriver.Chrome(options=options, executable_path='D:\Python\Python38\chromedriver.exe')
24 driver.get(urlpage)
---> 25 elements=WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.XPATH, "//a[text()='Country']")))
26 for elem in elements:
27 elem.click()
D:\Anaconda\lib\site-packages\selenium\webdriver\support\wait.py in until(self, method, message)
78 if time.time() > end_time:
79 break
---> 80 raise TimeoutException(message, screen, stacktrace)
81
82 def until_not(self, method, message=''):
TimeoutException: Message:
申し訳ありませんが、エラー メッセージを適切にフォーマットする方法がわかりません。再度、感謝します。