-
Notifications
You must be signed in to change notification settings - Fork 0
/
stub.py
51 lines (46 loc) · 1.2 KB
/
stub.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
styleSheet = """
QPushButton {
background-color: rgb(153, 158, 158);
color: black;
border-radius: 3px;
border: 2px solid black;
}
QPushButton:hover {
background-color: rgb(202, 204, 204);
color: black;
border: 2px solid black;
}
QLineEdit {
border-radius: 3px;
border: 2px solid grey;
}
"""
import requests
from bs4 import BeautifulSoup
cost_class = "_30jeq3 _16Jk6d"
star_class = "_3LWZlK"
title_class = "B_NuCI"
def get_cost(x):
try:
req = requests.get(x)
soup = BeautifulSoup(req.content, 'html.parser')
cost = soup.find('div', class_=cost_class).text
return cost
except:
pass
def get_star(x):
try:
req = requests.get(x)
soup = BeautifulSoup(req.content, 'html.parser')
star = soup.find('div', class_=star_class).text
return star
except:
pass
def get_title(x):
try:
req = requests.get(x)
soup = BeautifulSoup(req.content, 'html.parser')
title = soup.find('span', class_=title_class).text
return title
except:
pass