-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrapper.py
130 lines (95 loc) · 3.57 KB
/
scrapper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import bs4
import requests as rq
# from universal_skid import 2qi
# import skiddage
from os import system, name
import os
import time
def clear():
if os.name == 'nt':
os.system("cls")
else:
os.system('clear')
clear()
def module():
x = input("Voulez vous importer les modules ? [Y/N] : ")
if x == "Y":
import os
os.system("pip install time")
os.system("pip install bs4")
print("[+] INSTALLED --------------------------- BS4")
os.system("pip install requests")
print("[+] INSTALLED --------------------------- REQUESTS")
clear()
for x in range(2):
print(end="\r/")
time.sleep(0.5)
print(end="\r—")
time.sleep(0.5)
print(end="\r\\")
time.sleep(0.5)
else:
pass
module()
clear()
print("""
/T /I
/ |/ | .-~/
T\ Y I |/ / _
/T | \I | I Y.-~/
I l /I T\ | | l | T /
__ | \l \l \I l __l l \ ` _. |
\ ~-l `\ `\ \ \\\\ ~\ \ `. .-~ |
\ ~-. "-. ` \ ^._ ^. "-. / \ |
.--~-._ ~- ` _ ~-_.-"-." ._ /._ ." ./
>--. ~-. ._ ~>-" "\\\\ 7 7 ]
^.___~"--._ ~-{ .-~ . `\ Y . / |
<__ ~"-. ~ /_/ \ \I Y : |
^-.__ ~(_/ \ >._: | l______
^--.,___.-~" /_/ ! `-.~"--l_ / ~"-.
(_/ . ~( /' "~"--,Y -=b-. _)
(_/ . \ : / l c"~o \
\ / `. . .^ \_.-~"~--. )
(_/ . ` / / ! )/
/ / _. '. .': / '
~(_/ . / _ ` .-<_
/_/ . ' .-~" `. / \ \ ,z=.
~( / ' : | K "-.~-.______//
"-,. l I/ \_ __{--->._(==.
//( \ < ~"~" //
/' /\ \ \ ,v=. ((
.^. / /\ " }__ //===- `
/ / ' ' "-.,__ {---(==-
.^ ' : T ~" ll #43G
/ . . . : | :! \\\\
(_/ / | | j-" ~^
~-<_(_.^-~"
~-<_(_.^-~"
[+] Image Scrapper By anito #43G
""")
def pre_append(list, string):
temp_list = []
for item in list:
temp_item = string + item
temp_list.append(temp_item)
return temp_list
def main():
url = input('Entrez l\'url d\'un site web : ')
print("|---------------------------------------------| IMAGES TROUVES |---------------------------------------------|")
r = rq.get(url)
soup = bs4.BeautifulSoup(r.text, 'html.parser')
images = soup.find_all('img')
list_of_urls = []
for item in images:
list_of_urls.append(item['src'])
list_of_urls = pre_append(list_of_urls, '')
i = 0
for item in list_of_urls:
print(item)
print("|---------------------------------------------| IMAGES TROUVES |---------------------------------------------|")
main()
resez = input("\n\n\nVOULEZ-VOUS RECOMMENCER ? [Y/N] : ")
if resez == "Y":
main()
else:
pass