MCPcopy Create free account
hub / github.com/gawel/pyquery / after

Method after

pyquery/pyquery.py:1273–1287  ·  view source on GitHub ↗

add value after nodes

(self, value)

Source from the content-addressed store, hash-verified

1271 return self
1272
1273 def after(self, value):
1274 """add value after nodes
1275 """
1276 root, root_text = self._get_root(value)
1277 for i, tag in enumerate(self):
1278 if not tag.tail:
1279 tag.tail = ''
1280 tag.tail += root_text
1281 if i > 0:
1282 root = deepcopy(list(root))
1283 parent = tag.getparent()
1284 index = parent.index(tag) + 1
1285 parent[index:index] = root
1286 root = parent[index:len(root)]
1287 return self
1288
1289 @with_camel_case_alias
1290 def insert_after(self, value):

Callers 2

insert_afterMethod · 0.80

Calls 1

_get_rootMethod · 0.95

Tested by 1