+ 2
[** CODE CHALLENGE **] How to save an url that is accessible only after using credentials.
Can i write a program that can save contents of a url as pdf file. The contents of the url are accessible only after entering the credentials (username/password). The program should have attributes to define username & password, login & access the contents of the url, finally save it as a pdf.
9 ответов
+ 8
my Python is good for nothing, but of you share a link to the web page I might be able to give you some directions 😃
+ 6
@Amras A I fully agree with @visph on that. Usually you need to post username and password to a certain endpoint to get authentication, but might be completely different...
+ 5
Authentification cannot be treated as 'general' case, unfortunally... (but it's logical, as else that will be less secure ;P)
Each website could have its own specificities, even some technics could be used commonly (as 'basic' http authetification) ^^
+ 3
I don't know if this is the kind of thing you have in mind but it may be a starting point
http://pdfcrowd.com/web-html-to-pdf-JUMP_LINK__&&__python__&&__JUMP_LINK/
+ 2
I mean u can use beautufil soup to write something to a text document and them idk write something that'll change it to a pdf
+ 1
I think you can try and use the "requests" package, there is a nice way to use authentication
+ 1
@Nikolay Nachev: the point of this exercise is to be general: given a URL, needing authentification, save the content to a pdf file.
0
@David: thank you for giving direction. Now the problem is to pass credentials. Any help appreciated.
0
@faker: thank you.. Does beautiful soup have an agent to send username/password to the website? Yes, saving the file as PDF should be easy.