-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparselinks.py
More file actions
41 lines (29 loc) · 797 Bytes
/
parselinks.py
File metadata and controls
41 lines (29 loc) · 797 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
from bs4 import BeautifulSoup
text=""
with open("Recording Playback.html", "r", encoding='utf-8') as f:
text= f.read()
pagelink = "https://scalelitey.deu.edu.tr"
soup = BeautifulSoup(text, 'html.parser')
info = soup.find_all("video", {"id": "deskshare-video"})
xd = str(info)
lol = xd.split("source src=")
videolinewoparse= lol[1]
vlparsed = videolinewoparse.split(" ",1)
vl = vlparsed[0]
vl = vl.replace('"','')
print(vl)
link = pagelink + vl
print(link)
info1 = soup.find_all("video", {"class": "webcam"})
xd1 = str(info1)
lol1 = xd1.split("<source src=")
videolinewoparse1 = lol1[1]
vlparsed1 = videolinewoparse1.split(" ",1)
vl1 = vlparsed1[0]
vl1 = vl1.replace('"','')
link1 = pagelink + vl1
print(link1)
f = open("link.txt", "a")
f.write(link +"\n")
f.write(link1)
f.close()