We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7b56c0 commit 6dbeccbCopy full SHA for 6dbeccb
web-scraping/youtube-extractor/extract_video_info.py
@@ -9,15 +9,15 @@ def get_video_info(url):
9
# download HTML code
10
response = session.get(url)
11
# execute Javascript
12
- response.html.render(sleep=1)
+ response.html.render(timeout=60)
13
# create beautiful soup object to parse HTML
14
soup = bs(response.html.html, "html.parser")
15
# open("index.html", "w").write(response.html.html)
16
# initialize the result
17
result = {}
18
# video title
19
result["title"] = soup.find("meta", itemprop="name")['content']
20
- # video views (converted to integer)
+ # video views
21
result["views"] = soup.find("meta", itemprop="interactionCount")['content']
22
# video description
23
result["description"] = soup.find("meta", itemprop="description")['content']
0 commit comments