Commit a761547424c098689a27b48addd30d2a53dfecc9
1 parent
49b84075
Exists in
master
and in
5 other branches
removed comments
Showing
1 changed file
with
1 additions
and
4 deletions
Show diff stats
links/image-crawler.py
1 | -''' | ||
2 | from bs4 import BeautifulSoup | 1 | from bs4 import BeautifulSoup |
3 | from urllib.request import urlopen | 2 | from urllib.request import urlopen |
4 | import urllib.request | 3 | import urllib.request |
@@ -40,7 +39,7 @@ def get_images(url): | @@ -40,7 +39,7 @@ def get_images(url): | ||
40 | each = each[0:pos+4] | 39 | each = each[0:pos+4] |
41 | if not booleano: | 40 | if not booleano: |
42 | continue | 41 | continue |
43 | - | 42 | + |
44 | if each[0] + each[1] == '//' or each[0] == '/': | 43 | if each[0] + each[1] == '//' or each[0] == '/': |
45 | each = 'http:'+each | 44 | each = 'http:'+each |
46 | if each[0:4] != 'http' and each[0:5] != 'https': | 45 | if each[0:4] != 'http' and each[0:5] != 'https': |
@@ -52,5 +51,3 @@ def get_images(url): | @@ -52,5 +51,3 @@ def get_images(url): | ||
52 | urllib.request.urlretrieve(each,"%s"%(caminho)+str(contador)+filename) | 51 | urllib.request.urlretrieve(each,"%s"%(caminho)+str(contador)+filename) |
53 | except Exception: | 52 | except Exception: |
54 | continue | 53 | continue |
55 | - | ||
56 | -''' |