I want convert dict to json using json.dumps but i have problem with WebElement.
I got TypeError: Object of type WebElement is not JSON serializable
This my example code :
def x():
p = {'a':'a','b':driver.find_element(By.XPATH, xpath)}
return p
dict = x()
print(json.dumps(dict))
I want convert json except WebElement but without modify x function.