當前位置: 首頁>>代碼示例>>Golang>>正文


Golang cascadia.MustCompile函數代碼示例

本文整理匯總了Golang中github.com/bkand1909/song-getter/Godeps/_workspace/src/github.com/andybalholm/cascadia.MustCompile函數的典型用法代碼示例。如果您正苦於以下問題:Golang MustCompile函數的具體用法?Golang MustCompile怎麽用?Golang MustCompile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了MustCompile函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Is

// Is checks the current matched set of elements against a selector and
// returns true if at least one of these elements matches.
func (s *Selection) Is(selector string) bool {
	if len(s.Nodes) > 0 {
		return s.IsMatcher(cascadia.MustCompile(selector))
	}

	return false
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:9,代碼來源:query.go

示例2: ReplaceWith

// ReplaceWith replaces each element in the set of matched elements with the
// nodes matched by the given selector.
// It returns the removed elements.
//
// This follows the same rules as Selection.Append.
func (s *Selection) ReplaceWith(selector string) *Selection {
	return s.ReplaceWithMatcher(cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:8,代碼來源:manipulation.go

示例3: RemoveFiltered

// RemoveFiltered removes the set of matched elements by selector.
// It returns the Selection of removed nodes.
func (s *Selection) RemoveFiltered(selector string) *Selection {
	return s.RemoveMatcher(cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:5,代碼來源:manipulation.go

示例4: Before

// Before inserts the matched elements before each element in the set of matched elements.
//
// This follows the same rules as Selection.Append.
func (s *Selection) Before(selector string) *Selection {
	return s.BeforeMatcher(cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:manipulation.go

示例5: ChildrenFiltered

// ChildrenFiltered gets the child elements of each element in the Selection,
// filtered by the specified selector. It returns a new
// Selection object containing these elements.
func (s *Selection) ChildrenFiltered(selector string) *Selection {
	return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例6: ParentsFiltered

// ParentsFiltered gets the ancestors of each element in the current
// Selection. It returns a new Selection object with the matched elements.
func (s *Selection) ParentsFiltered(selector string) *Selection {
	return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:5,代碼來源:traversal.go

示例7: PrevUntil

// PrevUntil gets all preceding siblings of each element up to but not
// including the element matched by the selector. It returns a new Selection
// object containing the matched elements.
func (s *Selection) PrevUntil(selector string) *Selection {
	return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
		cascadia.MustCompile(selector), nil))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:7,代碼來源:traversal.go

示例8: Not

// Not removes elements from the Selection that match the selector string.
// It returns a new Selection object with the matching elements removed.
func (s *Selection) Not(selector string) *Selection {
	return s.NotMatcher(cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:5,代碼來源:filter.go

示例9: ParentsFilteredUntilNodes

// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the
// option to filter the results based on a selector string. It returns a new
// Selection object containing the matched elements.
func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
	return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), cascadia.MustCompile(filterSelector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例10: PrevAllFiltered

// PrevAllFiltered gets all the preceding siblings of each element in the
// Selection filtered by a selector. It returns a new Selection object
// containing the matched elements.
func (s *Selection) PrevAllFiltered(selector string) *Selection {
	return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例11: Find

// Find gets the descendants of each element in the current set of matched
// elements, filtered by a selector. It returns a new Selection object
// containing these matched elements.
func (s *Selection) Find(selector string) *Selection {
	return pushStack(s, findWithMatcher(s.Nodes, cascadia.MustCompile(selector)))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例12: ParentsFilteredUntil

// ParentsFilteredUntil is like ParentsUntil, with the option to filter the
// results based on a selector string. It returns a new Selection
// object containing the matched elements.
func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection {
	return filterAndPush(s, getParentsNodes(s.Nodes, cascadia.MustCompile(untilSelector), nil), cascadia.MustCompile(filterSelector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例13: ParentsUntil

// ParentsUntil gets the ancestors of each element in the Selection, up to but
// not including the element matched by the selector. It returns a new Selection
// object containing the matched elements.
func (s *Selection) ParentsUntil(selector string) *Selection {
	return pushStack(s, getParentsNodes(s.Nodes, cascadia.MustCompile(selector), nil))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:6,代碼來源:traversal.go

示例14: WrapInner

// WrapInner wraps an HTML structure, matched by the given selector, around the
// content of element in the set of matched elements. The matched child is
// cloned before being inserted into the document.
//
// It returns the original set of elements.
func (s *Selection) WrapInner(selector string) *Selection {
	return s.WrapInnerMatcher(cascadia.MustCompile(selector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:8,代碼來源:manipulation.go

示例15: PrevFilteredUntil

// PrevFilteredUntil is like PrevUntil, with the option to filter
// the results based on a selector string.
// It returns a new Selection object containing the matched elements.
func (s *Selection) PrevFilteredUntil(filterSelector, untilSelector string) *Selection {
	return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
		cascadia.MustCompile(untilSelector), nil), cascadia.MustCompile(filterSelector))
}
開發者ID:psufighter,項目名稱:song-getter,代碼行數:7,代碼來源:traversal.go


注:本文中的github.com/bkand1909/song-getter/Godeps/_workspace/src/github.com/andybalholm/cascadia.MustCompile函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。