my code:-
mean_distances = [td.text.strip() for td in rows[3].find_all('td') ]
Output:-
mean_distances: ['Mean distance from the Sun', 'km AU', '57,909,175
0.38709893', '108,208,930 0.72333199', '149,597,890 1.00000011', '227,936,640 1.52366231', '778,412,010 5.20336301', '1,426,725,400
9.53707032', '2,870,972,200 19.19126393', '4,498,252,900 30.06896348']
I want to extract only the numbers in km (ignore the second number expressing the distance in AU) and covert the str data to float value. How can I do it?