How to Parse HTML Tables to JSON With Python

preview_player
Показать описание
A fun and simple Python Project for beginners, scraping football league table data from HTML to a python dictionary to JSON file.

Extracting Data and Transforming it into another format is a necessary skill to learn, and in this video I will show you how to take the data from an HTML table online and turn it into a well structured Python Dictionary and in turn a JSON file. JSON is the best format for moving and dealing with data and either of the 2 methods I show will work in making your life easier.

-------------------------------------
Disclaimer: These are affiliate links and as an Amazon Associate I earn from qualifying purchases
-------------------------------------
Рекомендации по теме
Комментарии
Автор

This channel is the best by far for learning web scraping but i think that it would be better to focus only on scrapy framework. Surely it is the best tool by far. It is complete, powerful and easy to learn.

samibenhssan
Автор

Great content, Last two months i kept learning python and web scraping thanks to you John i learned a lot and i am advancing day by day.
Thank you and do keep at it

androidmod
Автор

Nice explenation for list comprehension. From your videos I have learned a lot of new things about web scraping and also Python. Thanks for your content.

janisvelbergs
Автор

John, thank you for keeping the channel blessed with the micro lessons! It takes a lot to consistently put this level of quality out here. I appreciate you!

Kylbigel
Автор

dict(zip(list_a, list)) is neat. Thanks John!

rickhehe
Автор

Very neat and clean code...and as always, well explained 🙂

gisleberge
Автор

Thanks for sharing. Just started with web scraping and the data I need is typically presented in tables.

sandrasoniec
Автор

So good to see how you do it! I am reading a book on web scraping, « Web scraping with Python » from Ryan Mitchell, and it’s great to watch your videos on the back of it, it all becomes clearer and alive. Thank you!

rbzh
Автор

WTF! This tutorial is clear and easy to follow. I have subscribed and like the video. By the way, what are the use of dict() and zip()? I love list comprehension.

silientlips
Автор

Funny. I have just started experimenting with Json in Phyton. Your video will help me a lot.
Thank you for your share.

iamkian
Автор

Hi John, I was wondering if you could make a video on how to bypass cloudfare when scraping a website? I've tried using the correct headers/cookies and continuously changing the user agent but I still can't seem to get past certain websites which use cloudfare

haidernadeem
Автор

Hey, i want to check when a changement is made in a webpage, and i was wondering
Am i supposed to perform a request every x seconds, or is there a way to check when a changement is made ?

heq
Автор

Hello, how could I add 3 replace for columns 0, 2 and 3?

AndreSpecker
Автор

Can we create a project like WP Automatic plugin or like Scrapes, these are wordpress plugins that automatically scrap content post it on website. They also have scheduling option

lalitchowdhary
Автор

when i use pandas my th is not becoming cols instead its generating 0, 1, 2 for cols and putting th and td as data rows
why is it not putting th as headers?

tetricko
Автор

Hi John, nice video and, more generally, channel :) I have tried to adapt and reproduce your project on another website. It was a dynamic on so I use render, but when I try to get the absolute links of the web page it returns 'set()' as many times as there is a link in the page. Did you ever have this problem?
Have a good day :)

gauthiervigouroux
Автор

Great channel.
May I ask - if you were interesting in closely monitoring infrequent changes to a website (e.g. the "company news" page of a company you own stock in), do you have a gut-feel as to the best way to go about it? I anticipate newly released news would have its own "page". Perhaps simplest approach to crawl the website every X hours, list all of the "links", and check if the list has changed.

harryhindsight
Автор

But this module is not fetching the html files from the local. How can I do that?

artmania
Автор

Hi Jhon, big fan here. i gotta question, why do you stop using requests + bs4?

javierjdaza
Автор

hello john can you make a video on scrapping world population data website please i tried but failed beacuse the span tag is constandly changing

ZenoModiff