I want to scrape pdf files from this site https://www.sigmaths.net/Reader.php?var=manuels/ph/physique_pilote_7b.pdf I tried this code for that but it doesn’t work. Can anybody tell me why, please?
JavaScript
x
4
1
res = requests.get('https://www.sigmaths.net/Reader.php?var=manuels/ph/physique_7b.pdf')
2
with open('C:\Users\sioud\Desktop\Manuels scolaires TN\1\test.pdf', 'wb') as f:
3
f.write(ress.content)
4
Advertisement
Answer
JavaScript
1
4
1
res = requests.get('https://www.sigmaths.net/manuels/ph/physique_7b.pdf',stream=True)
2
with open('test.pdf', 'wb') as f:
3
f.write(res.content)
4
your url is pointing to a reader https://www.sigmaths.net/Reader.php?var=manuels/ph/physique_7b.pdf
, remove the 'reader.php?var=
for the actual pdf