File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ def get_video_info(url):
9
9
# download HTML code
10
10
response = session .get (url )
11
11
# execute Javascript
12
- response .html .render (sleep = 1 )
12
+ response .html .render (timeout = 60 )
13
13
# create beautiful soup object to parse HTML
14
14
soup = bs (response .html .html , "html.parser" )
15
15
# open("index.html", "w").write(response.html.html)
16
16
# initialize the result
17
17
result = {}
18
18
# video title
19
19
result ["title" ] = soup .find ("meta" , itemprop = "name" )['content' ]
20
- # video views (converted to integer)
20
+ # video views
21
21
result ["views" ] = soup .find ("meta" , itemprop = "interactionCount" )['content' ]
22
22
# video description
23
23
result ["description" ] = soup .find ("meta" , itemprop = "description" )['content' ]
You can’t perform that action at this time.
0 commit comments