如何从脚本功能中抓取?

时间:2019-01-06 00:14:30

标签: python-3.x web-scraping

无法在网页的脚本功能中抓取数据

如何从网页的以下摘录中抓取经度和纬度?

(function(k,v){
    RIGHTMOVE.ANALYTICS.DataLayer.pushKV(k,v);
}('property',{"location":{"postcode":"PO35 5AA","country":"GB","latitude":50.69098481264069,"longitude":-1.0907815665453167},"propertyId":64613653,"viewType":"Current","imageCount":10,"floorplanCount":0,"videoProvider":"No Video","propertyInfo":{"propertyType":"Flats / Apartments","propertySubType":"Flat","price":244450.0,"beds":1,"added":"20180322","soldSTC":false,"retirement":true,"preOwned":"Resale","ownership":"Non-shared ownership","auctionOnly":false,"letAgreed":false,"lettingType":null,"furnishedType":null,"minSizeFt":null,"maxSizeFt":null,"minSizeAc":null,"maxSizeAc":null,"businessForSale":false,"priceQualifier":"Guide Price","currency":"GBP","selectedPrice":null,"selectedCurrency":null}}));

rightmove_analytics = soup.find('script', attrs={'function': 'RIGHTMOVE.ANALYTICS.DataLayer.push(k,v)'})
print('rightmove_analytics:', rightmove_analytics)

我想获取经度和纬度数据

0 个答案:

没有答案