Beautiful Soup ã使ã£ã¦ã¯ãã¼ã©ã¼ãæ¸ã HTML ã®åå¾ã¯ requests ã使ããHTML ã®ãã¼ã¹å¦çã Beautiful Soup ã§ããã®ãåºæ¬çãªä½¿ãæ¹ã§ãã import requests from bs4 import BeautifulSoup # ã¹ã¯ã¬ã¤ãã³ã°å¯¾è±¡ã® URL ã«ãªã¯ã¨ã¹ããéã HTML ãåå¾ãã res = requests.get('http://quotes.toscrape.com/') # ã¬ã¹ãã³ã¹ã® HTML ãã BeautifulSoup ãªãã¸ã§ã¯ããä½ã soup = BeautifulSoup(res.text, 'html.parser') # title ã¿ã°ã®æååãåå¾ãã title_text = soup.find('title').get_text() print(title_text) # >
{{#tags}}- {{label}}
{{/tags}}