MCPcopy
hub / github.com/projectdiscovery/katana / bodyATagParser

Function bodyATagParser

pkg/engine/parser/parser.go:173–185  ·  view source on GitHub ↗

------------------------------------------------------------------------- Begin Body based parsers ------------------------------------------------------------------------- bodyATagParser parses A tag from response

(resp *navigation.Response)

Source from the content-addressed store, hash-verified

171
172// bodyATagParser parses A tag from response
173func bodyATagParser(resp *navigation.Response) (navigationRequests []*navigation.Request) {
174 resp.Reader.Find("a").Each(func(i int, item *goquery.Selection) {
175 href, ok := item.Attr("href")
176 if ok && href != "" {
177 navigationRequests = append(navigationRequests, navigation.NewNavigationRequestURLFromResponse(href, resp.Resp.Request.URL.String(), "a", "href", resp))
178 }
179 ping, ok := item.Attr("ping")
180 if ok && ping != "" {
181 navigationRequests = append(navigationRequests, navigation.NewNavigationRequestURLFromResponse(ping, resp.Resp.Request.URL.String(), "a", "ping", resp))
182 }
183 })
184 return
185}
186
187// bodyLinkHrefTagParser parses link tag from response
188func bodyLinkHrefTagParser(resp *navigation.Response) (navigationRequests []*navigation.Request) {

Callers 1

TestBodyParsersFunction · 0.85

Calls 2

StringMethod · 0.45

Tested by 1

TestBodyParsersFunction · 0.68