Commit 42a586aa authored by 王明明's avatar 王明明

更换goquery

parent b515d23b
...@@ -63,6 +63,11 @@ func (akm *AkmClient) Init() error { ...@@ -63,6 +63,11 @@ func (akm *AkmClient) Init() error {
return err return err
} }
scripts := htmlquery.Find(doc, "//script[@type=\"text/javascript\"]") scripts := htmlquery.Find(doc, "//script[@type=\"text/javascript\"]")
if len(scripts) == 0 {
respUri, _ := resp.Location()
akm.logger.WithError(err).Info("无法找到sensorurl url: " + respUri.RequestURI())
return errors.New("无法找到sensorurl url: " + respUri.RequestURI())
}
startIdx := len(scripts) - 1 startIdx := len(scripts) - 1
lastScript := scripts[startIdx] lastScript := scripts[startIdx]
for startIdx > 0 { for startIdx > 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment