【发布时间】:2015-10-21 20:49:06
【问题描述】:
我是python的新手,在网上搜索了一些尝试后,有点困惑。我想要做的是:从网站中提取一些信息,其页面源包含以下信息。我想提取最后括号中包含的纬度/经度信息:19.xxxxx,-19.xxxxx。
我的想法是搜索 myOptions,然后检索括号内的坐标。我该如何实施?谢谢!
<script>
function initialize() {
var map, mapOptions, info, i, func, func1, borrar, capa,
marcador = [], marcadorcalle = [], locales = [], calles = [];
func = function (num, tipo) {
return function () {
if (tipo) {
info.setContent('<b>' + calles[num][0] + '</b>');
info.open(map, marcadorcalle[num]);
} else {
info.setContent('<b>' + locales[num][0] + '</b><br />' + locales[num][3]);
info.open(map, marcador[num]);
}
};
};
func1 = function (objeto, tipo) {
return function () {
if (tipo) {
if (borrar) {borrar.setMap(null); }
borrar = objeto;
objeto.setMap(map);
}
map.setZoom(18);
map.setCenter(objeto.getPosition());
google.maps.event.trigger(objeto, 'click');
};
};
mapOptions = {
zoom: 16,
scrollwheel: false,
center: new google.maps.LatLng(19.xxxxx, -19.xxxxx)
};
【问题讨论】:
标签: python regex text web-scraping extract