Re: [閒聊] 直接貼程式碼已回收
試了一下 到 final_data 都沒有出現 "\"
為啥還要用一個 turn_string_to_dict
直接 json.loads(final_data) 就好了吧
html = requests.get(url + s_url)
start = html.text.find("(")
end = html.text.rfind(")")
final_data = html.text[start+1:end]
final_data = json_data.replace("sections", '"sections"')
print(json.loads(final_data))
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.137.241.71 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1661175422.A.B09.html
→
08/22 21:38,
3年前
, 1F
08/22 21:38, 1F
討論串 (同標題文章)