# Path to the chromedriver program
service = Service('C:\Program Files (x86)\Google\chromedriver.exe')
service.start()
# Driver opens the remote with robinhood website
driver = webdriver.Remote(service.service_url)
driver.get('https://robinhood.com/crypto/BTC')
# We will grab the element id's to log on to Robinhood
# driver.find_element_by_id(“ID”).send_keys(“username”)
# driver.find_element_by_id (“ID”).send_keys(“password”)
# driver.find_element_by_id(“submit”).click()
signinButton = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CLASS_NAME, "_3kh8OsNx6QdAbMaoKTi2Yq _1uaripz9PIQ8yApSTs6BKk")))
# driver.find_element_by_class_name('_3kh8OsNx6QdAbMaoKTi2Yq _1uaripz9PIQ8yApSTs6BKk')
signinButton.click()
# Closes the driver after timeout
driver.quit()
我基本上是打开 chrome webdriver 并访问 robinhood 网站,但是我遇到了网页加载问题。为了修复它,我尝试使用 WebDriverWait 停止按钮单击,直到加载网页。
问题是按钮单击在 10 秒过去后不会执行,而是抛出此错误:
Traceback (most recent call last):
File "D:/gitRepos/bitmine/runmine.py", line 25, in <module>
signinButton = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CLASS_NAME, "_3kh8OsNx6QdAbMaoKTi2Yq _1uaripz9PIQ8yApSTs6BKk")))
File "D:\Programs Files 2\Python\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
阿波罗的战车
海绵宝宝撒
繁花不似锦
Helenr
相关分类