スクレイピング Python
メモ。
import urllib2 from bs4 import BeautifulSoup html = urllib2.urlopen("http://www.oreilly.co.jp/index.shtml") soup = BeautifulSoup(html,"lxml") list = soup.find_all("a") for i in list: print i.string,i.get("href")
メモ。
import urllib2 from bs4 import BeautifulSoup html = urllib2.urlopen("http://www.oreilly.co.jp/index.shtml") soup = BeautifulSoup(html,"lxml") list = soup.find_all("a") for i in list: print i.string,i.get("href")