单击后从浏览器获取未混淆的源代码
网页的某些内容以某种复杂的方式进行了混淆(至少对我来说)。我无法从页面源中解读它。无论如何,当单击页面上的链接时,将调用 onclick java 函数并且页面变得可读。此时,浏览器中生成的源代码也是可读的。
是否有一个编程工具(如 mechanize 或某物,最好是 perl)可以在 Firefox 中加载页面,单击链接,然后获取未加密的 html?
有什么建议如何解决这个问题吗?
A webpage has some contents obfuscated in some sophisticated way (at least for me). I'm unable to decipher it from the page source. Anyway, when clicking a link on a page, an onclick java function gets called and the page becomes readable. At that point, also the generated source in the browser is readable.
Is there a programming tool (like mechanize or sth., preferrably perl) that would load a page in Firefox, click the link and then get the unchipered html?
Any suggestions how to attack this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用 Chrome 并在开发人员工具、javascript 查看器中检查反混淆源选项。
Try using Chrome and check the deobfuscate source option, in the developer tools, javascript viewer.
我将使用 Firebug 来查看反混淆代码。
当您查看源代码时,浏览器将向您显示原始源代码,而不是当前的 DOM。当您使用 Firebug 查看源代码时,它将显示当前源代码,这将是您的浏览器当前显示的内容。
仅当您想查看 HTML 时,此方法才有效,而当您需要以编程方式提取时则无效。
I would use Firebug to view the deobfuscated code.
When you view source, browsers will show you the original source, not the current DOM. When you view source with Firebug, it will show you the current source, which will be what your browser is currently showing.
This approach will only work if you want to see the HTML, and not if you need programmatic extraction.
尝试 Firefox 的 Greymonkey 插件。
您可以编写一个小的 JavaScript 函数来为您单击该按钮,例如每次在 Firefox 中加载页面时。查看 userscripts.org 以开始使用。
这仅适用于(在您的浏览器内)单个客户端,即您。
如果您需要完全自动化,您可以尝试记录 Selenium 测试用例。为此,您可以使用另一个 Firefox 插件“Selenium IDE”(Microsoft Office 资深人士将其称为“宏记录器”),甚至可以将您录制的测试用例转换为 Perl 代码。
(运行测试用例需要启动另一个小组件,selenium rc(基于 java 的服务器),它将为您启动 Firefox 并单击链接。
Try the greasemonkey add-on for firefox.
You can write a little javascript function that clicks that button for you, e.g. each time you load the page in Firefox. Check out userscripts.org to get started.
This would work (inside your browser) only for a single client and that is you .
If you need it fully automated, you can try to record a Selenium testcase. You can use another Firefox Add-On, "Selenium IDE" for this (Microsoft Office veterans would call this a "Macro Recorder") and even convert your recorded testcase to Perl code.
(Running the testcase would require to start up another little component, selenium rc (a java-based server) which would start up firefox for you and click the link.