所以我试图做一个程序,告诉用户多远,旅行者1号是从地球上,美国航空航天局有这方面的信息在他们的网站http://voyager.jpl.nasa.gov/where/index.html ... 我似乎无法管理在专区内获得的信息,这里的DIV:<div id="voy1_km">Distance goes here</div>
使用BeautifulSoup的HTML抓取
我现在的程序如下:`
import requests
from BeautifulSoup import BeautifulSoup
url = "http://voyager.jpl.nasa.gov/where/index.html"
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html)
test = soup.find('div', {'id' : 'voy1_km'})
print test
所以长话短说,我如何获得的股利内容?
什么是输出?尝试打印回应HTML和汤,检查它是否破的任何地方 – MohitC
它只是输出
检查来源,
什么也没有。改变的价值由JS – MohitC