如何以编程方式填写 AJAX 表单并抓取结果?
基本上,我想使用 Facebook 广告管理工具来估计一组特定定位参数所定位的用户数量。我知道有一个已发布的 API 可用,但只有当您在他们的广告应用程序“白名单”上时才可用。我确信我所问的是可能的。另外,了解更多有关抓取的知识会很有趣。
Facebook 的广告管理工具基本上是其广告 API 的 AJAX UI。在创建活动的过程中,您可以指定定位参数,页面会在您修改参数时动态报告定位的用户数。根据我在网络上和 stackOverflow 上读到的内容,可以使用 Firebug 或类似的工具来区分页面发出的请求以及请求的位置,然后模仿这些调用来获取您想要的信息。
我在解释 Firebug 的面板时遇到困难。我认为我尝试发送请求的 URI 是 www.facebook.com/ajax/inventory_estimator.php,尽管我不确定如何形成呼叫。
那么,如果我想编写一个脚本或程序,将单词列表用作关键字并返回每个关键字的估计用户数,我该怎么做呢?
链接到 Facebook 的广告管理工具、活动创建页面: http://www.facebook.com/ads/create
Basically, I want to use the Facebook Ads Manager Tool to estimate the number of users targeted by a particular set of targeting parameters. I know there is a published API available, but it is only usable if you are on their advertising application "whitelist." I am sure what I am asking is possible. Plus, it would be interesting to learn more about scraping.
Facebook's Ads Manager Tool is basically an AJAX UI for their ads API. In the process of creating a campaign, you can specify targeting parameters, and the page will dynamically report the number of users targeted as you modify the parameters. From what I've read on the web and here on stackOverflow, it is possible to use Firebug or a similar tool to pick apart what requests are being made by the page and to where, then mimicking these calls to get the information you want.
I'm having trouble interpreting the panels of Firebug. I think the URI I'm trying to send a request to is www.facebook.com/ajax/inventory_estimator.php, though I'm not sure how to form a call.
So, if I want to write a script or program that takes a list of words to use as keywords and returns the estimated number of users for each keyword, how could I do it?
Link to Facebook's Ads Manager Tool, Campaign Creation Page:
http://www.facebook.com/ads/create
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,使用像 firebug 这样的扩展来检查 HTTP 请求是一个好方法。
“网络”选项卡就是您想要的选项卡(最后一个)。
yes using an extension like firebug to examine the HTTP requests is a good way to do this.
The Net tab is the one you want (last one).
您尝试过 irobotsoft 网络爬虫吗?它有很好的ajax支持。
在这里查看他们的论坛:http://irobotsoft.org/bb/YaBB.pl
Have you tried irobotsoft webscraper? It has a good ajax support.
Check their forum here: http://irobotsoft.org/bb/YaBB.pl