-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathThe Crawler
41 lines (30 loc) · 887 Bytes
/
The Crawler
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
from bs4 import BeautifulSoup
import requests
import re
def thecrawler(maxpages,movie):
page = 1
searchnetnaija(movie)
while page < maxpages:
searchtoxicwap()
def searchtoxicwap():
url="www.toxicwap.com"
def searchnetnaija(movie):
search = True
while(search):
print('This works')
url1="http://www.netnaija.com/videos/movies"
sourcecode = requests.get(url1)
plain_text = sourcecode.text
soup = BeautifulSoup(plain_text,'lxml')
list = []
for link in soup.find_all('a'):
lin = link.get('href')
list.append(lin)
search = False;
for dat in list:
x = re.search(r'movies',dat)
if x:
s = r'%s' % movie
y = re.search(s,dat)
if y:
print(dat)