Documentation
¶
Index ¶
- Variables
- func ApolloLogin(browser *rod.Browser, acc *models.Account, timeout time.Duration, stealth bool) (page *rod.Page, err error)
- func FetchCreditUsage(page *rod.Page, acc *models.Account, timeout time.Duration) (credits int, refreshTime *models.Time, err error)
- func GoToPage(page *rod.Page, pageNumber int, timeout time.Duration) error
- func GrabErrorSnapshot(page *rod.Page, acc *models.Account, errorDir string) error
- func LocateList(page *rod.Page, listName string, timeout time.Duration) error
- func RemoveAnnoyance(page *rod.Page, annoyance *Annoyance, timeout time.Duration) error
- func SaveLeads(page *rod.Page, listName string, timeout time.Duration) error
- func ScrapeLeads(page *rod.Page, timeout time.Duration) ([]*models.Lead, error)
- type Annoyance
- type ApolloTab
- type PageData
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorListEnd is an error which is returned when there are no more leads to save/scrape // in the given list, i.e., we have reached the end of the list. ErrorListEnd = errors.New("reached end of list") // on the current page. ErrorNavButtonsNotFound = errors.New("failed to find page navigation buttons") )
var ( // NewUIAnnoyance represents the dialog shown to users using the // updated Apollo UI. NewUIAnnoyance = &Annoyance{ Name: "New UI popup", Regex: "Skip tour", Selector: ".zp_p2Xqs.zp_v565m.zp_qhNxC", ActionFunc: simpleClick, } // PopupDialogAnnoyance represents a generic popup dialog shown at random // moments while using Apollo. PopupDialogAnnoyance = &Annoyance{ Name: "Dialog popups", Regex: "Got it", Selector: ".zp_tZMYK", ActionFunc: simpleClick, } // while using the rod stealth library. SidenavAnnoyance = &Annoyance{ Name: "Sidebar", Selector: "#side-nav", ActionFunc: func(e *rod.Element) error { return e.Remove() }, } // TopBannerAnnoyance represents the banner at the top of the Apollo page which // sometimes appears and hinders scraping. TopBannerAnnoyance = &Annoyance{ Name: "Top banner", Selector: "[data-variant=black] button[aria-label=Dismiss]", ActionFunc: simpleClick, } )
var ErrorSecurityChallenge = errors.New("encountered a cloudflare turnstile challenge")
ErrorSecurityChallenge is returned when a Cloudflare Turnstile captcha challenge has been encountered at the time of logging in.
Functions ¶
func ApolloLogin ¶
func ApolloLogin( browser *rod.Browser, acc *models.Account, timeout time.Duration, stealth bool, ) (page *rod.Page, err error)
ApolloLogin is a page action that logs into apollo.io with the provided *models.Account's credentials. If arg: stealth is set to true, the resulting page will be launched in stealth mode.
func FetchCreditUsage ¶
func FetchCreditUsage( page *rod.Page, acc *models.Account, timeout time.Duration, ) (credits int, refreshTime *models.Time, err error)
FetchCreditUsage is a page action that fetches credit usage information for the provided *models.Account from Apollo. This function returns the amount of credits remaining and a *models.Time value indicating when credits will be renewed.
func GoToPage ¶
GoToPage is a page navigation function that navigates to the specified page number on the 'People' page on Apollo. This function assumes you're on the 'People' page on Apollo.
func GrabErrorSnapshot ¶
GrabErrorSnapshot is a page action which grabs a screenshot and the rendered HTML of the current page and saves them in the specified directory.
func LocateList ¶
LocateList is a page action that navigates to the Apollo list with the provided listName.
func RemoveAnnoyance ¶
RemoveAnnoyanceis a page action which searches for all available instances of the specified *Annoyance on the current page and performs the action specified by [*Annoyance.ActionFunc] for each of them.
Types ¶
type ApolloTab ¶
type ApolloTab string
ApolloTab represents the tabs on the Apollo 'People' page.
The names of the tabs found on the Apollo 'People' page.
type PageData ¶
PageData represents all available data regarding the page number, size, etc., on the current page.
func GetPageData ¶
GetPageData is a page action that returns a *PageData value representing all available data regarding the page number, size, etc,. This function only works on the 'People' page on Apollo. This function assumes you're on the 'People' page on Apollo.