Skip to content
Advertisement

get a list from html source using python3

I am trying to get Cases list of COVID-19 positive cases from https://www.worldometers.info/, e.g. this

The sample looks like(~line no: 700) :

JavaScript

I am using bs4 as:

JavaScript

which does scrape the file, but after that I am clueless how to get the data. The list I am looking for is commented with ## I NEED THIS LIST. Kindly help.

Advertisement

Answer

You could write a regex for it

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement