You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\browser_decorator.py", line 295, in wrapper_browser
write_output(
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\decorators_common.py", line 202, in write_output
write_json(result, filename, False)
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\output.py", line 90, in write_json write_json(data, filename)
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\utils.py", line 52, in write_json
json.dump(data, fp, indent=indent)
File "C:\Python312\Lib\json_init.py", line 179, in dump
for chunk in iterable:
^^^^^^^^
File "C:\Python312\Lib\json\encoder.py", line 430, in _iterencode
yield from _iterencode_list(o, _current_indent_level)
File "C:\Python312\Lib\json\encoder.py", line 326, in _iterencode_list
yield from chunks
File "C:\Python312\Lib\json\encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "C:\Python312\Lib\json\encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Element is not JSON serializable
the JSON library is working so I am not sure what the issue is.
The text was updated successfully, but these errors were encountered:
My code running in a windows 10 instance:
from botasaurus.browser import browser, Driver
@browser (reuse_driver=True)
def scrape_data(driver: Driver, link):
driver.get(link)
return driver.get_all_elements_with_exact_text("Equipment Install/Dismantle History")
url = "https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/ee6ff9b281d8448f96b4fe6c89f2bdc8/a18e976c8a244478a79e3b4177d525dc.html"
output = scrape_data(url)
print(output)
I get a json error:
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\browser_decorator.py", line 295, in wrapper_browser
write_output(
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\decorators_common.py", line 202, in write_output
write_json(result, filename, False)
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\output.py", line 90, in write_json
write_json(data, filename)
File "C:\Users\XXX\AppData\Roaming\Python\Python312\site-packages\botasaurus\utils.py", line 52, in write_json
json.dump(data, fp, indent=indent)
File "C:\Python312\Lib\json_init.py", line 179, in dump
for chunk in iterable:
^^^^^^^^
File "C:\Python312\Lib\json\encoder.py", line 430, in _iterencode
yield from _iterencode_list(o, _current_indent_level)
File "C:\Python312\Lib\json\encoder.py", line 326, in _iterencode_list
yield from chunks
File "C:\Python312\Lib\json\encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "C:\Python312\Lib\json\encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Element is not JSON serializable
the JSON library is working so I am not sure what the issue is.
The text was updated successfully, but these errors were encountered: