我可以使用 urllib 获取 html 页面,并使用 BeautifulSoup 解析 html 页面,看起来我必须生成要从 BeautifulSoup 读取的文件。
import urllib
sock = urllib.urlopen("http://SOMEWHERE")
htmlSource = sock.read()
sock.close()
--> write to file
有没有办法在不从 urllib 生成文件的情况下调用 BeautifulSoup?