Skip to content

Commit 0dbef51

Browse files
Update README.md
1 parent 96612fd commit 0dbef51

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
# image crawler in python
22
## Introduction
33
Find all the images from a website and download to your project folder. Purpose of this project is to learning coding in Python. Please do not use it to your production server yet.
4+
```python
5+
from Crawler.Page import Page
6+
from Crawler.Image import Image
7+
from Image.Download import Download
8+
9+
if __name__ == '__main__':
10+
page = Page('http://fdfashionltd.com');
11+
# fetch all the links (anchor) of this website
12+
links = page.fetch_links();
13+
14+
for link in links:
15+
# fetch all of the images of a web url
16+
img = Image(link);
17+
images = img.fetch_links();
18+
# Download all of the images
19+
download = Download(links=links)
20+
download.start()
21+
```
22+
This code is to demonstrate the flow of the work. Please run main.py code because threading are used there. So program will be completed lot faster than this one.

0 commit comments

Comments
 (0)