Skip to content

Commit 6dbeccb

Browse files
committed
update extracting youtube data tutorial
1 parent b7b56c0 commit 6dbeccb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web-scraping/youtube-extractor/extract_video_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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']

0 commit comments

Comments
 (0)