• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang cascadia.MustCompile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中golicense/Godeps/_workspace/src/github.com/andybalholm/cascadia.MustCompile函数的典型用法代码示例。如果您正苦于以下问题:Golang MustCompile函数的具体用法?Golang MustCompile怎么用?Golang MustCompile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MustCompile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: After

// After applies the selector from the root document and inserts the matched elements
// after the elements in the set of matched elements.
//
// If one of the matched elements in the selection is not currently in the
// document, it's impossible to insert nodes after it, so it will be ignored.
//
// This follows the same rules as Selection.Append.
func (s *Selection) After(selector string) *Selection {
	return s.AfterMatcher(cascadia.MustCompile(selector))
}
开发者ID:blackss2,项目名称:golicense,代码行数:10,代码来源:manipulation.go


示例2: 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:blackss2,项目名称:golicense,代码行数:5,代码来源:filter.go


示例3: 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:blackss2,项目名称:golicense,代码行数:6,代码来源:manipulation.go


示例4: PrevFilteredUntilNodes

// PrevFilteredUntilNodes is like PrevUntilNodes, 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) PrevFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection {
	return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevUntil,
		nil, nodes), cascadia.MustCompile(filterSelector))
}
开发者ID:blackss2,项目名称:golicense,代码行数:7,代码来源:traversal.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:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例6: 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:blackss2,项目名称:golicense,代码行数:8,代码来源:manipulation.go


示例7: Closest

// Closest gets the first element that matches the selector by testing the
// element itself and traversing up through its ancestors in the DOM tree.
func (s *Selection) Closest(selector string) *Selection {
	cs := cascadia.MustCompile(selector)
	return s.ClosestMatcher(cs)
}
开发者ID:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例8: 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:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例9: 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:blackss2,项目名称:golicense,代码行数:7,代码来源:traversal.go


示例10: 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:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例11: 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:blackss2,项目名称:golicense,代码行数: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:blackss2,项目名称:golicense,代码行数: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:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例14: 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:blackss2,项目名称:golicense,代码行数:5,代码来源:traversal.go


示例15: 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:blackss2,项目名称:golicense,代码行数:5,代码来源:manipulation.go


示例16: 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:blackss2,项目名称:golicense,代码行数:7,代码来源:traversal.go


示例17: 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:blackss2,项目名称:golicense,代码行数:8,代码来源:manipulation.go


示例18: PrevFilteredUntilSelection

// PrevFilteredUntilSelection is like PrevUntilSelection, 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) PrevFilteredUntilSelection(filterSelector string, sel *Selection) *Selection {
	return s.PrevMatcherUntilSelection(cascadia.MustCompile(filterSelector), sel)
}
开发者ID:blackss2,项目名称:golicense,代码行数:6,代码来源:traversal.go


示例19: Append

// Append appends the elements specified by the selector to the end of each element
// in the set of matched elements, following those rules:
//
// 1) The selector is applied to the root document.
//
// 2) Elements that are part of the document will be moved to the new location.
//
// 3) If there are multiple locations to append to, cloned nodes will be
// appended to all target locations except the last one, which will be moved
// as noted in (2).
func (s *Selection) Append(selector string) *Selection {
	return s.AppendMatcher(cascadia.MustCompile(selector))
}
开发者ID:blackss2,项目名称:golicense,代码行数:13,代码来源:manipulation.go


示例20: Add

// Add adds the selector string's matching nodes to those in the current
// selection and returns a new Selection object.
// The selector string is run in the context of the document of the current
// Selection object.
func (s *Selection) Add(selector string) *Selection {
	return s.AddNodes(findWithMatcher([]*html.Node{s.document.rootNode}, cascadia.MustCompile(selector))...)
}
开发者ID:blackss2,项目名称:golicense,代码行数:7,代码来源:expand.go



注:本文中的golicense/Godeps/_workspace/src/github.com/andybalholm/cascadia.MustCompile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang appengine.NewContext函数代码示例发布时间:2022-05-28
下一篇:
Golang log.Debug函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap