I'm interested in scrapping data from a website, and pass the data for use it in PHP. I have had a look around, and the best suggestion I have been able to find is to first serialise the Python data and then pass it along.
The issue I have is that I'm unsure how to serialise the Python data.
I'm using Selenium, and I have the following code.
test = browser.find_elements_by_css_selector("table#resultstable td")
I can see the data I want to use by running the variable through a loop and printing it.
for val in test:
print(val.text)
However when I try to serialise the object, I receive the following error:
json.dumps(test)
....
TypeError: Object of type 'WebElement' is not JSON serializable!
I Hope somebody can point me in the right direction, I'm happy in PHP but I have only begun to look Python recently.