fix: Python handler Fixed (#51)
Some checks failed
Unit Tests / unit-tests (push) Has been cancelled

* Fix: Python handler Fixed

* fix: Python handler Fixed without comment
This commit is contained in:
c3Nz
2024-11-26 17:05:43 +01:00
committed by GitHub
parent d65e600ec3
commit ef35db00d7

View File

@@ -163,7 +163,10 @@ async def collect_scraped_elements(page: tuple[str, str], xpaths: list[Element])
el = sxpath(root, elem.xpath)
for e in el:
text = "\t".join(str(t) for t in e.itertext())
if isinstance(e, etree._Element):
text = "\t".join(str(t) for t in e.itertext())
else:
text = str(e)
captured_element = CapturedElement(
xpath=elem.xpath, text=text, name=elem.name
)