获取网页的CSS,JS和HTML [英] Get CSS, JS and HTML of web page

查看:281
本文介绍了获取网页的CSS,JS和HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们通过我们的应用程序点击URL时,有没有办法获取网页的CSS,JS和HTML。



(即点击www.msn.com我可以获得页面的css,js和html,这可以通过C#代码实现)



应用程序可以是控制台,窗口和网络。



在此先感谢:)

Is there any way to get CSS, JS and HTML of web page when we hit the URL through our application.

(i.e. hit www.msn.com and I can get css, js and html of page, this can be achieve via C# code)

Application can be console, window and web.

Thanks in Advance :)

推荐答案

您列出了发送到客户端的资源,否则您的浏览器会无法使用应用程序或网页。



使用.NET,您只需要使用类 System.Net.HttpWebRequest

http:// msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx [ ^ ]。



基本上,你需要使用的技巧w ^ eb报废 http://en.wikipedia.org/wiki/Web_scraping [ ^ ]。



请看看我过去的答案:

获取具体数据来自网页 [ ^ ],

如何从其他网站获取数据 [ ^ ]。



-SA
You are listing the resources which are sent to the client side, otherwise your browser would not work with the applications or Web pages.

With .NET, all you need is to use the class the class System.Net.HttpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

Basically, you need to use the techniques of Web scrapping: http://en.wikipedia.org/wiki/Web_scraping[^].

Please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA


引用:

5 HTML,CSS和JavaScript Com的在线游乐场削减



1)CSSDesk

2)JS Bin

3)jsFiddle

4)Dabblet

5)Tinkerbin



请查看以下链接了解更多详情



5 Online Playgrounds for HTML, CSS and JavaScript Compared

1) CSSDesk
2) JS Bin
3) jsFiddle
4) Dabblet
5) Tinkerbin

Please check the below link for further details



[ ^ ]


这篇关于获取网页的CSS,JS和HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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