Ruby
1# encoding: utf-8
2
3require 'open-uri'
4require 'certified'
5
6url = 'https://www.ted.com/talks/adam_grant_the_surprising_habits_of_original_thinkers'
7
8data = open(url, &:read)
9
10data =~ /"tags":\[(.+?)\]}\],"/
11
12tags = $1.split(',')
13
14puts tags.map { |e| e.gsub(/[\\|"]/, '').capitalize }
15
16=begin
17 Business
18 Creativity
19 Curiosity
20 Decision-making
21 Exploration
22 Failure
23 Innovation
24 Invention
25 Leadership
26 Motivation
27 Personal growth
28 Potential
29 Success
30 Work
31=end
32
恐らく、script内のこれだと思います。
html内にそのまま書いてあるのでSeleniumなどを
使わなくても大丈夫だと思います。
#追記
keywordでもできるかもしれません。
Ruby
1# encoding: utf-8
2
3require 'open-uri'
4require 'certified'
5
6url = 'https://www.ted.com/talks/adam_grant_the_surprising_habits_of_original_thinkers'
7
8data = open(url, &:read)
9
10data =~ /meta name="keywords" content="TED, talks,(.+?)"/
11
12tags = $1.split(',')
13
14puts tags.map { |e| e.strip.capitalize }
15
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/22 03:35
2017/07/22 15:28