duckgo

package
v0.0.0-...-6705ef6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://html.duckduckgo.com/html/?q=%s"
)

Variables

This section is empty.

Functions

func Init

func Init(fetcherType string, headless bool)

Types

type SearchResult

type SearchResult struct {
	Rank       int    // 排名
	Title      string // 标题
	URL        string // 链接
	DisplayURL string // 显示的URL
	Source     string // 来源网站名称
	Snippet    string // 摘要
	Date       string // 日期(如果有)
	IsAd       bool   // 是否是广告
	IconURL    string // 图标URL
	HasDate    bool   // 是否有日期
}

func ParseNormalResult

func ParseNormalResult(html string) ([]SearchResult, error)

func ParseStaticResult

func ParseStaticResult(html string) ([]SearchResult, error)

func Query

func Query(query string, n int) ([]SearchResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL