mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-15 04:05:50 +00:00
fix: Python handler Fixed (#51)
Some checks failed
Unit Tests / unit-tests (push) Has been cancelled
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:
@@ -163,7 +163,10 @@ async def collect_scraped_elements(page: tuple[str, str], xpaths: list[Element])
|
|||||||
el = sxpath(root, elem.xpath)
|
el = sxpath(root, elem.xpath)
|
||||||
|
|
||||||
for e in el:
|
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(
|
captured_element = CapturedElement(
|
||||||
xpath=elem.xpath, text=text, name=elem.name
|
xpath=elem.xpath, text=text, name=elem.name
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user