从LS获取城市列表时遇到问题 [英] Trouble getting a list of cities from LS

查看:124
本文介绍了从LS获取城市列表时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在努力获得一个LS城市的数组... file_get_contents()返回一个空的下拉菜单,他们的路障,要求你选择城市。不幸的是它是空的...所以然后我认为这是来自一个ajax请求。但是看着页面我没有看到任何ajax请求在页面上。然后我尝试CURL,认为也许模拟浏览器会有帮助...下面的代码没有影响。

I'm struggling getting an array of LS cities... file_get_contents() returns an empty dropdown on their roadblock requiring you to select cities. Unfortunately it's empty... so then I thought it was coming from an ajax request. But looking at the page I don't see any ajax requests on the page. Then I tried CURL, thinking that maybe simulating a browser would help... the below code had no affect.

$ch = curl_init("http://www.URL.com/");
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)');
$result=curl_exec($ch);
var_dump($result);

有没有人对如何获得可用区域的完整列表有任何想法?

Does anyone have any ideas on how I can get a solid list of available areas?

推荐答案

也许有点晚了,但你不需要耦合到我们的JavaScript来获取城市列表。我们有一个API:

Perhaps a bit late, but you don't need to couple to our JavaScript to obtain the cities list. We have an API for that:

https://sites.google.com/a/hungrymachine.com/livingsocial-api/home/cities

这篇关于从LS获取城市列表时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆