mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
- 新增 BrowserPool 结构和相关方法,用于管理和复用浏览器实例 - 在 CrawlerApi 中集成浏览器池,使用 FetchPage 方法获取页面内容 -优化了配置获取方式,统一使用 GetConfig() 函数 -修复了一些代码中的小问题,如错误处理和日志记录
30 lines
588 B
Go
30 lines
588 B
Go
package data
|
|
|
|
import (
|
|
"go-stock/backend/db"
|
|
"testing"
|
|
)
|
|
|
|
// @Author spark
|
|
// @Date 2025/2/17 12:44
|
|
// @Desc
|
|
// -----------------------------------------------------------------------------------
|
|
func TestGetDaily(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
tushareApi := NewTushareApi(GetConfig())
|
|
res := tushareApi.GetDaily("00927.HK", "20250101", "20250217", 30)
|
|
t.Log(res)
|
|
|
|
}
|
|
|
|
func TestGetUSDaily(t *testing.T) {
|
|
db.Init("../../data/stock.db")
|
|
tushareApi := NewTushareApi(GetConfig())
|
|
|
|
res := tushareApi.GetDaily("gb_AAPL", "20250101", "20250217", 30)
|
|
t.Log(res)
|
|
|
|
//
|
|
|
|
}
|