-3

hi friends

i am a beginner in python programming. I have written code to download 16 pdf files. I am getting the pdf file but I am unable to open the file it is showing error. please help me.

import re,urllib
url="http://www.ncbi.nlm.nih.gov/books/NBK16"
id1=[30,24,25,28,22,23,14,33,21,29,16,27,18,20,17,26]
j=1;

for i in id1:
address= url+str(i)+'/pdf/ch'+str(j)+'.pdf'
print address
handle=urllib.urlretrieve(address,'ch'+str(j)+'.pdf')
print "HCV book ch"+str(j)+".pdf is succefully downloaded"
j+=1

----------

Edited by Nick Evan: n/a

Votes + Comments
Hi! Please make new thread for youre problem, thanks!
2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by hema dhevi.N
0

hi friends
please help me out of that problem my previous code is working for other websites i am able to download other pdf files. I want to know why it is not working for this site. when i copy and paste this site to web browser i am able to download the pdf files. why it is not working when i code this.
please give a solution to this problem
even i tried with wget it is giving error 403: forbidden

0

If you know a good project, please post it here. If you have questions, start your own thread and don't clutter the sticky.

0

I don't have any intension to confuse anyone its my doubt about handling PDF files. I am new to this forum and python programming also.
I will post my questions as a new thread after this. Even if you typed your suggestion in black text i would have accept it and try to learn how to post new threads.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.