code
[root@localhost ~]# cat test.py import sys,os from selenium import webdriver import time from selenium.webdriver.common.keys import Keys option = webdriver.ChromeOptions() option.add_argument(‘--no-sandbox‘) option.add_argument(‘--headless‘) driver = webdriver.Chrome(options=option) driver.get("https://www.coincola.info/trading/btc/usdt") while(True): driver.implicitly_wait(3.5) time.sleep(2) price=driver.find_element_by_class_name("d6VoI").text print(price) print(driver.title) driver.quit() [root@localhost ~]#
原文:https://www.cnblogs.com/sea-stream/p/14413034.html