mirror of
https://github.com/taroved/pol
synced 2025-05-19 07:40:08 -07:00
elements tails for text
This commit is contained in:
parent
ef235a9d09
commit
9ac0f13581
3
feed.py
3
feed.py
@ -17,7 +17,7 @@ def element_to_string(element):
|
|||||||
s = [element.text] if element.text else []
|
s = [element.text] if element.text else []
|
||||||
for sub_element in element:
|
for sub_element in element:
|
||||||
s.append(etree.tostring(sub_element))
|
s.append(etree.tostring(sub_element))
|
||||||
if element.tail:
|
if sub_element.tail:
|
||||||
s.append(element.tail)
|
s.append(element.tail)
|
||||||
return ''.join(s)
|
return ''.join(s)
|
||||||
|
|
||||||
@ -29,7 +29,6 @@ def buildFeed(response, feed_config):
|
|||||||
response.selector.remove_namespaces()
|
response.selector.remove_namespaces()
|
||||||
|
|
||||||
tree = response.selector._root.getroottree()
|
tree = response.selector._root.getroottree()
|
||||||
|
|
||||||
# get data from html
|
# get data from html
|
||||||
items = []
|
items = []
|
||||||
for node in tree.xpath(feed_config['xpath']):
|
for node in tree.xpath(feed_config['xpath']):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user