Python中文
首页
教程
问答
标签
搜索
登录
注册
如何在靓汤中刮经纬度
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我对beauthulsoup4相当陌生,从下面的代码中提取html响应中的纬度和经度值时遇到了困难。在</p> <pre><code>url = 'http://cinematreasures.org/theaters/united-states?page=1' r = requests.get(url) soup = BeautifulSoup(r.content) links = soup.findAll("tr") print links </code></pre> <p>这个代码多次打印出这个响应。在</p> ^{pr2}$ <p>全tr响应</p> <p/><div^{cl1}$ <div^{cl2}$ <pre class="snippet-code-html lang-html prettyprint-override"><code><tr>\n <th id="theater_name"><a href="/theaters/united-states?sort=name&amp;order=desc">\u2191 Name</a> </th>\n <th id="theater_location"><a href="/theaters/united-states?sort=location&amp;order=asc">Location</a> </th>\n <th id="theater_status"><a href="/theaters/united-states?sort=open&amp;order=desc">Status</a> </th>\n <th id="theater_screens"><a href="/theaters/united-states?sort=screens&amp;order=asc">Screens</a> </th>\n</tr>, <tr class="even location theater" data="{id: 0, point: {lng: -94.1751038, lat: 36.0848965}, category: 'open'}">\n <td class="name">\n <a class="map-link" href="/theaters/8775"> <img alt="112 Drive-In" height="48" src="http://photos.cinematreasures.org/production/photos/22137/1313612883/thumb.JPG?1313612883" width="48" /> </a>\n<a class="map-link" href="/theaters/8775">112 Drive-In</a>\n <div class="info-box">\n <div class="photo" style="float: left;"> <a href="/theaters/8775"> <img alt="thumb" height="48" src="http://photos.cinematreasures.org/production/photos/22137/1313612883/thumb.JPG?1313612883" width="48" /> </a> </div>\n <p style="min-width: 200px !important;">\n<strong><a href="/theaters/8775">112 Drive-In</a></strong>\n <br>\n 3352 Highway 112 North <br>Fayetteville, AR 72702 <br>United States <br>479.442.4542 <br>\n</br> </br> </br> </br> </br> </p>\n</div>\n</td>\n <td class="location">\n Fayetteville, AR, United States\n</td>\n <td class="status">\n Open\n</td>\n <td class="screens">\n 1\n</td>\n</tr></code></pre> </div> </div> <p>我该如何从该响应中获取lng和lat值?在</p> <p>提前谢谢你。在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>如果您只希望得到一个响应,请执行以下操作:</p> <pre><code>print links[0] </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
为什么我的神经网络模型的准确性不能在这个训练集上得到提高?
2 回答
为什么我的神经网络模型的权重变化不大?
1 回答
为什么我的神经网络的成本不断增加?
2 回答
为什么我的神经网络的输入pickle文件是19GB?
1 回答
为什么我的神经网络给属性错误?“非类型”对象没有属性“形状”
7 回答
为什么我的神经网络训练这么慢?
4 回答
为什么我的神经网络输出错误?
5 回答
为什么我的神经网络预测适用于MNIST手绘图像时是正确的,而适用于我自己的手绘图像时是不正确的?
10 回答
为什么我的神经网络验证精度比我的训练精度高,而且它们都是常数?
6 回答
为什么我的私人用户间聊天会显示在其他用户的聊天档案中?
9 回答
为什么我的积分的绝对误差估计值大于积分(使用scipy.integrate.nqad)?
9 回答
为什么我的积层回归器得分比它的组件差?
10 回答
为什么我的移动方法不起作用?
10 回答
为什么我的稀疏张量不能转换成张量
10 回答
为什么我的稀疏张量不能转换成张量?
8 回答
为什么我的程序“停止”了?
1 回答
为什么我的程序一直试图占用所有可用的CPU
4 回答
为什么我的程序不使用指定的代理
4 回答
为什么我的程序不工作(python帮助中的反向函数)?
2 回答
为什么我的程序不工作时,我使用多处理模块
7 回答