如何将href中的javascript:__ doPostBack链接转换为wget / curl / lynx可以理解的普通url? [英] How to convert a link that has javascript:__doPostBack in href to normal url which wget/curl/lynx can understand?

查看:1081
本文介绍了如何将href中的javascript:__ doPostBack链接转换为wget / curl / lynx可以理解的普通url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我首先搜索了SO,然后发现了这个问题。 如何点击包含javascript的链接:__ doPostBack在href?但它只给出了python中的答案。

I searched in SO first, and found this question. How to click a link that has javascript:__doPostBack in href? but it gives the answer in python only.

我需要的是,当浏览一个网站时,有些页面(2,3,4) ,等等)链接如下:

What I need is, when go through a website, some pages (2,3,4, etc) with links like below:

javascript:__doPostBack('AspNetPager1','2')
javascript:__doPostBack('AspNetPager1','3')
javascript:__doPostBack('AspNetPager1','4')

如果我点击它,它将显示下一页,但真实的网址不会显示在浏览器中。

If I click it, and it will display the next page, but the real url isn't displayed in browser.

所以我的问题是,如何将javascript链接转换为可追溯的真实网址并将其转换为 wget / curl / lynx

So my questions is, how can I convert the javascript link into traceable real url and feed to wget/curl/lynx?

我的目的是使用工具(wget / curl / lynx)通过脚本逐个下载这些页面。但由于这些 javascript:__ doPostBack ,我找不到一个好办法。

My purpose is to use the tools (wget/curl/lynx) to download these pages one by one by scripting. But because of these javascript:__doPostBack, I can't find a good way to do it.

推荐答案

你不能真正分析地做到这一点。 __ doPostBack 可能是任意复杂的。

You can't really do it analytically. __doPostBack could be arbitrarily complex.

你应该做的是安装Firebug(假设你使用的是Firefox),激活网络选项卡,按持久,然后单击该按钮。 网络选项卡将显示实际的网络流量,您可以从中推断出真实的网址。实际上,您只需右键单击您感兴趣的特定网络请求,然后选择复制为cURL,它将在您的粘贴缓冲区中添加卷曲说明 - 包括Cookie和标题等内容。

What you should do instead is install Firebug (assuming you are using Firefox), activate the Network tab, press "Persist", and then click that button. The Network tab will show you the actual network traffic, and you can deduce the real URLs from that. In fact, you can just right-click on the particular network request that interests you and select "Copy as cURL" and it will put the curl instructions -- complete with things like cookies and headers -- in your paste buffer.

Chrome内置了类似的功能。

There is a similar function built-in to Chrome.

这篇关于如何将href中的javascript:__ doPostBack链接转换为wget / curl / lynx可以理解的普通url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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