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):
99 # download HTML code
1010 response = session .get (url )
1111 # execute Javascript
12- response .html .render (sleep = 1 )
12+ response .html .render (timeout = 60 )
1313 # create beautiful soup object to parse HTML
1414 soup = bs (response .html .html , "html.parser" )
1515 # open("index.html", "w").write(response.html.html)
1616 # initialize the result
1717 result = {}
1818 # video title
1919 result ["title" ] = soup .find ("meta" , itemprop = "name" )['content' ]
20- # video views (converted to integer)
20+ # video views
2121 result ["views" ] = soup .find ("meta" , itemprop = "interactionCount" )['content' ]
2222 # video description
2323 result ["description" ] = soup .find ("meta" , itemprop = "description" )['content' ]
You can’t perform that action at this time.
0 commit comments