-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscrape.py
More file actions
45 lines (30 loc) · 910 Bytes
/
scrape.py
File metadata and controls
45 lines (30 loc) · 910 Bytes
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
from bs4 import BeautifulSoup
import requests
url="https://tutsgalaxy.com"
data=requests.get(url)
url2="https://www.yify-torrent.org/popular.html"
data2=requests.get(url2)
url3="https://www.yify-torrent.org/latest.html"
data3=requests.get(url3)
print("---------------Courses---------------")
print()
soup=BeautifulSoup(data.text,'html.parser')
for article in soup.find_all('article'):
headline=article.h3.a.text
link=article.h3.a
print(headline)
print()
print("------------Movies by Popular------------")
print()
soup2=BeautifulSoup(data2.text,'html.parser')
for article in soup2.find_all('article'):
movie=article.figcaption.h3.a.text
print(movie)
print()
print("------------Movies by Latest------------")
print()
soup3=BeautifulSoup(data3.text,'html.parser')
for article in soup3.find_all('article'):
movie=article.figcaption.h3.a.text
print(movie)
print()