我正在从一个以这种格式定义时间的网络中收集数据。本地时间为2018年10月23日09:18的条件。基于给定的格式,我想将其转换为ISO格式。
为了摆脱多余的文字,我采用了这种方法:
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)
此代码的结果如下:
09:24
23
October
2018
有人可以在这里引导我吗?
谢谢