Skip to content

Instantly share code, notes, and snippets.

@shiumachi
Created January 26, 2014 14:10
Show Gist options
  • Save shiumachi/8633275 to your computer and use it in GitHub Desktop.
Save shiumachi/8633275 to your computer and use it in GitHub Desktop.
指定したURLのBeautifulSoupオブジェクトを取得する(BeautifulSoup4版)
# -*- coding: utf-8 -*-
# requirement: lxml
import requests
from bs4 import BeautifulSoup
URL = "https://gist.github.com/"
def get_soup(url=URL):
""" get soup object of url.
"""
return BeautifulSoup(requests.get(gf_wiki_url).text, "lxml")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment