We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 791e09b commit 86134a2Copy full SHA for 86134a2
scrap_file.py
@@ -16,7 +16,21 @@ def download(url):
16
f.close()
17
print("Succesfully Downloaded")
18
19
+#Function is do same thing as method(download) do,but more strict
20
+def download_2(url):
21
+ try:
22
+ response = requests.get(url)
23
+ except Exception:
24
+ print('Failed Download!')
25
+ else:
26
+ if response.status_code == 200:
27
+ with open('file_name.jpg','wb') as f:
28
+ f.write(requests.get(url).content)
29
+ print("Succesfully Downloaded")
30
31
32
+
33
url='https://avatars0.githubusercontent.com/u/29729380?s=400&v=4' #URL from which we want to download
-
34
35
download(url)
36
0 commit comments