mirror of
https://github.com/edoardottt/cariddi.git
synced 2026-09-28 04:24:58 +02:00
Now print results at request, not response
This commit is contained in:
+6
-4
@@ -45,9 +45,13 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency
|
||||
// This is to avoid to insert into the crawler target regular
|
||||
// expression directories passed as input.
|
||||
var targetTemp string
|
||||
var protocolTemp string
|
||||
// if there isn't a scheme use http.
|
||||
if !utils.HasScheme(target) {
|
||||
targetTemp = utils.GetHost("http://" + target)
|
||||
protocolTemp = "http"
|
||||
targetTemp = utils.GetHost(protocolTemp + "://" + target)
|
||||
} else {
|
||||
protocolTemp = utils.GetProtocol(target)
|
||||
targetTemp = utils.GetHost(target)
|
||||
}
|
||||
if intensive {
|
||||
@@ -205,9 +209,7 @@ func Crawler(target string, txt string, html string, delayTime int, concurrency
|
||||
})
|
||||
|
||||
// Start scraping on target
|
||||
c.Visit("http://" + target)
|
||||
c.Visit("https://" + target)
|
||||
c.Wait()
|
||||
c.Visit(protocolTemp + "://" + target)
|
||||
if html != "" {
|
||||
output.FooterHTML(html)
|
||||
}
|
||||
|
||||
+10
-1
@@ -39,7 +39,16 @@ func GetHost(input string) string {
|
||||
return u.Host
|
||||
}
|
||||
|
||||
//GetHost >
|
||||
//GetProtocol >
|
||||
func GetProtocol(input string) string {
|
||||
u, err := url.Parse(input)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return u.Scheme
|
||||
}
|
||||
|
||||
//GetRootHost >
|
||||
func GetRootHost(input string) string {
|
||||
_, err := url.Parse(input)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user