Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Browser ¶
Browser simulates a simple web browser using Selenium
func NewBrowser ¶
NewBrowser returns a new Browser object. In the background, it initializes a new Selenium service and uses Firefox as the browser.
func (*Browser) Close ¶
func (b *Browser) Close()
Close will clean up and close the Browser. Must be called when the program us done using the Browser.
func (*Browser) GetSource ¶
func (b *Browser) GetSource(cssSelect string) (WebsiteSource, error)
GetSource returns the source code of the current webpage If cssSelect is empty, the whole page is returned. If it is specified, the source code of the element pointed at by cssSelect will be returned.
func (*Browser) NavigateTo ¶
NavigateTo navigates to the specified url
type WebsiteSource ¶
WebsiteSource represents the source code of a website
func GetAllWebsitesFromFiles ¶
func GetAllWebsitesFromFiles() ([]WebsiteSource, []string, error)
GetAllWebsitesFromFiles reads the folder savedWebsites and returns all the websites in there. First argument returned is the websites themselves, and the second is the name of the file themselves.
func (*WebsiteSource) WriteToFile ¶
func (w *WebsiteSource) WriteToFile() error
WriteToFile writes this WebsiteSource to a file under the folder savedWebsites