Tips and tricks for handling JSON in your scraping operations
Hi Pierluigi, maybe it is worth mentioning that Playwright and Requests response objects have built-in json() functions.
So in your example, instead of doing
data = json.loads(response.text())
You can do
data = response.json()
which, I believe, is a bit more concise.
Hi Alex, believe it or not, I was not aware of that! Thanks for sharing. I'm spending too much time with CSV files :)
Hi Pierluigi, maybe it is worth mentioning that Playwright and Requests response objects have built-in json() functions.
So in your example, instead of doing
data = json.loads(response.text())
You can do
data = response.json()
which, I believe, is a bit more concise.
Hi Alex, believe it or not, I was not aware of that! Thanks for sharing. I'm spending too much time with CSV files :)