Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotLogin = errors.New("Could not login, check your credentials.")
View Source
var ErrInvalidConfig = errors.New("Invalid config, missing crawl ops.")
View Source
var ErrInvalidSelector = errors.New("Invalid selector for pagination.")
View Source
var ErrInvalidUrlHrefInPagination = errors.New("Pagination found but url in href not found.")
View Source
var ErrNoHrefInPagination = errors.New("Pagination found but no href inside.")
View Source
var ErrNoLoginCreds = errors.New("No login credentials provided, login needed.")
Functions ¶
This section is empty.
Types ¶
type CrawlDescriptor ¶
type CrawlResult ¶
a single crawling result with relative error if the case
type ElementCrawler ¶
type ElementCrawler interface {
Extract(r *http.Response, resChan chan CrawlResult)
}
the interface that must be implemented to crawl a single element of the list
type HrefPaginationHandler ¶
type HrefPaginationHandler struct {
Selector string `json:"selector"`
}
a simple pagination handler that extracts the href from the specified element
type ListEater ¶
type ListEater struct { LoginDesc *LoginDescriptor CrawlDesc *CrawlDescriptor Client *http.Client Paginator PaginationHandler }
the listeater type, the main type of this package
func (*ListEater) Crawl ¶
func (le *ListEater) Crawl(resChan chan CrawlResult, elementCrawler ElementCrawler, creds *LoginCredentials) error
the main listeater function, does the actual crawling
type ListEaterConfig ¶
type ListEaterConfig struct { Login *LoginDescriptor `json:"login"` Crawl *CrawlDescriptor `json:"crawl"` }
type LoginCredentials ¶
type LoginCredentials struct {
// contains filtered or unexported fields
}
credentials for login (if needed)
type LoginDescriptor ¶
Click to show internal directories.
Click to hide internal directories.