Closed Eon1 closed 7 years ago
At the moment it does not click links, just extract the URL string from the href attribute and open it using private methods.
You can extract the URLs the same way
bow.Find("a").Each(func(I int, sel *goquery.Selection){
var src string
src, ok := sel.Attr("href")
// open the link
// look at the click method:
// bow.httpGet ...
})
https://github.com/headzoo/surf/blob/master/browser/browser.go#L346
This helped me out thanks .
Is it possible to click a link that doesn't have a class name like this ?
<a href="/some/kind/of/link">The Link</a>
I know you can do
bow.Click("a.new")
Like in the docs which will find any anchor with the class "new" but how do we click a link by just if it has a anchor tag and some text like "The Link" ?Click wants a selector string. Is there any way to get that from bow.Find ? I can get all the links with
But then bow.Click wants a selection string and I have a goquery.Selection. How do I click the link once I've found it ?