|
if md5 != old_md5: print("資料已更新") sp=BeautifulSoup(html,'html.parser') jsondata=ast.literal_eval(sp.text) conn.execute("delete from TablePM25") conn.commit() n=1 for site in jsondata: SiteName=site["SiteName"] if site["PM2.5"]=="ND": continue
出現 File "pm25.py", line 35, in <module> for site in jsondata: NameError: name 'jsondata' is not defined 問題可能是出現在哪裡(電字書沒參考檔可看)? |