我正在搞乱 BeautifulSoup,发现尽管代码或连接没有任何变化,但有时解析页面需要很长时间。有任何想法吗?
from bs4 import BeautifulSoup
from urllib2 import urlopen
#The particular state website:
site = "http://sfbay.craigslist.org/rea/"
html = urlopen(site)
print "Done"
soup = BeautifulSoup(html)
print "Done"
#Get first 100 list of postings:
postings = soup('p')