Skip to content

Commit c05d39e

Browse files
committed
Application flow shown on test.py file
1 parent 0dbef51 commit c05d39e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

test.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
from queue import Queue
1+
from Crawler.Page import Page
2+
from Crawler.Image import Image
3+
from Image.Download import Download
24

3-
def do_stuff(q):
4-
while not q.empty():
5-
print(q.get())
6-
q.task_done()
5+
if __name__ == '__main__':
6+
page = Page('http://fdfashionltd.com');
7+
# fetch all the links (anchor) of this website
8+
links = page.fetch_links();
79

8-
q = Queue(maxsize=0)
9-
10-
for x in range(20):
11-
q.put(x)
12-
13-
do_stuff(q)
10+
for link in links:
11+
# fetch all of the images of a web url
12+
img = Image(link);
13+
images = img.fetch_links();
14+
# Download all of the images
15+
download = Download(links=links)
16+
download.start()

0 commit comments

Comments
 (0)