命令行URL获取与JavaScript能力 [英] Command line URL fetch with JavaScript capabliity

查看:156
本文介绍了命令行URL获取与JavaScript能力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用curl,在php和httplib2在python中获取URL。

I use curl, in php and httplib2 in python to fetch URL.

但是,有一些页面使用JavaScript

However, there are some pages that use JavaScript (AJAX) to retrieve the data after you have loaded the page and they just overwrite a specific section of the page afterward.

那么,有没有可以处理JavaScript的命令行实用程序?

So, is there any command line utility that can handle JavaScript?

要知道我的意思是去:monster.com并尝试搜索一个工作。

To know what I mean go to: monster.com and try searching for a job.

你会看到Ajax以后得到工作的名单。所以,如果我想根据我的关键字搜索来提交工作,我会得到没有工作的页面。

You'll see that the Ajax is getting the list of jobs afterward. So, if I wanted to pull in the jobs based on my keyword search, I would get the page with no jobs.

但通过浏览器工作。

推荐答案

获取FireBug 并查看该Ajax请求的URL。然后,您可以使用该网址的curl。

Get FireBug and see the URL for that Ajax request. You may then use curl with that URL.

这篇关于命令行URL获取与JavaScript能力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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