求問,如何爬取學科網上的試題,試題url地址是:http://www.zxxk.com/soft/12958988.html?spm=a1.b4.c3.d27。我是個門外漢,最近稍微看了點爬蟲,就試著爬取一下。但是我發現有2個問題,第一個這個試題只能預覽幾頁,第二個就是好像是圖片格式,于是我嘗試用第一張圖片的url地址爬取連第一張圖片都沒成功,懇求大家幫我完善下代碼,然后匯出為pdf
import requests
path = "./bcde.jpg"
#試題第一頁圖片url地址
url = "https://img.zxxk.com/2/?key=63ffcbc1bba83dea329566fce179d0c0.svg"
r = requests.get(url)
print(r.status_code)
with open(path,'wb') as f:
f.write(r.content)
r.status_code == 200正常
uj5u.com熱心網友回復:

難度系數比較大,url里面的key值是md5生成的,加密了
uj5u.com熱心網友回復:
嗯,好的,謝謝你。uj5u.com熱心網友回復:
非公開資源資料,無法直接獲取轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/71991.html
上一篇:ValueError: could not broadcast input array from shape (4) into shape (3)
下一篇:Python對檔案進行分行排序
