1

I am scrapping data from a web where time has been defined in this format Conditions at local time 09:18 on 23 October 2018 . Based on the given format i want to convert it in ISO format.

To get rid of extra text i followed this approach:

soup = BeautifulSoup(homePage.content, 'html.parser')
time1 = soup.find("caption")
time2 = time1.get_text().split()
filtter = ["Conditions", "at", "local", "time", "on"]
for m in  time2:
#print(m)
if m not in filtter:
    test = m
    print(test.split)

Result of this code is below:

09:24
23
October
2018

Can anyone guide me here?

Thanks

JG in SD
  • 5,427
  • 3
  • 34
  • 46
Northern Shadow
  • 303
  • 1
  • 4
  • 16

0 Answers0