Skip to content

Commit

Permalink
fix: Python handler Fixed (#51)
Browse files Browse the repository at this point in the history
* Fix: Python handler Fixed

* fix: Python handler Fixed without comment
  • Loading branch information
n0c3Nz authored Nov 26, 2024
1 parent d65e600 commit ef35db0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/backend/scraping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit ef35db0

Please sign in to comment.