【发布时间】:2011-02-08 11:37:01
【问题描述】:
我可以使用urllib获取html页面,并使用BeautifulSoup解析html页面,看来我必须生成要从BeautifulSoup读取的文件。
import urllib
sock = urllib.urlopen("http://SOMEWHERE")
htmlSource = sock.read()
sock.close()
--> write to file
有没有办法在不从 urllib 生成文件的情况下调用 BeautifulSoup?
【问题讨论】:
标签: python web-scraping beautifulsoup urllib2