【发布时间】:2016-08-18 10:25:14
【问题描述】:
我有这个代码:
from bs4 import BeautifulSoup
import urllib2
from lxml import html
from lxml.etree import tostring
trees = urllib2.urlopen('http://aviationweather.gov/adds/metars/index? station_ids=KJFK&std_trans=translated&chk_metars=on&hoursStr=most+recent+only&ch k_tafs=on&submit=Submit').read()
soup = BeautifulSoup(open(trees))
print soup.get_text()
item=soup.findAll(id="info")
print item
但是,当我在窗口上输入汤时,它给了我一个错误,当我的程序运行时,它给了我一个很长的 html 代码
等等。任何帮助都会很棒。
【问题讨论】:
标签: python beautifulsoup