go-stock/backend/data/pool_test.go
ArvinLovegood 3402f0d296 feat(data):实现浏览器实例池化
- 新增 BrowserPool 结构和相关方法,用于管理和复用浏览器实例
- 在 CrawlerApi 中集成浏览器池,使用 FetchPage 方法获取页面内容
-优化了配置获取方式,统一使用 GetConfig() 函数
-修复了一些代码中的小问题,如错误处理和日志记录
2025-03-31 23:08:09 +08:00

19 lines
372 B
Go

package data
import (
"go-stock/backend/db"
"testing"
)
func TestPool(t *testing.T) {
db.Init("../../data/stock.db")
pool := NewBrowserPool(1)
go pool.FetchPage("https://fund.eastmoney.com/016533.html", "body")
go pool.FetchPage("https://fund.eastmoney.com/217021.html", "body")
go pool.FetchPage("https://fund.eastmoney.com/001125.html", "body")
select {}
}