我正在开发一个读取URL的项目,然后转到链接并读取数据。它是一个文本托管网站(TextUploader.com)但是当它下载网站时。我只想要我放在那里的文本中的数据。当我下载链接并将其发送到RichTextBox1时,这就是我得到的
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>'HPTjNRgUfG' | TextUploader.com</title>
<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link rel="icon" type="image/ico" href="http://textuploader.com/favicon.ico">
<meta property="og:title" content="HPTjNRgUfG" xmlns="http://www.w3.org/1999/html"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://textuploader.com/5jx4u"/>
<meta property="og:site_name" content="textuploader.com - HPTjNRgUfG"/>
<meta property="og:description" content="Please call back later <a href=" http://philadelphiaexplorers.org/about-the-explorers-club/#annual ">a..."/>
<link rel="canonical" href="http://textuploader.com/5jx4u"/>
<!-- bootstrap framework css -->
<link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap.min.css">
<link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css">
<!-- power tooltips -->
<link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip.css">
<!-- main stylesheet -->
<link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/beoro.css">
<link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/tu_custom.css">
<!--[if lte IE 8]><link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/ie8.css">
<![endif]-->
<!--[if IE 9]><link media="all" type="text/css" rel="stylesheet" href="http://textuploader.com/assets/css/ie9.css">
<![endif]-->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2pre/html5shiv.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/flot/0.7/excanvas.min.js"></script>
<![endif]-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36314765-1']);
_gaq.push(['_setDomainName', 'textuploader.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<link media="all" type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="bg_c">
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=456470037742170";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- main wrapper (without footer) -->
<div class="main-wrapper">
<!-- top bar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<div class="pull-right top-search">
</div>
<div id="fade-menu" class="pull-left">
<ul class="clearfix" id="mobile-nav">
<li><a href="http://textuploader.com/">Home</a></li>
<li><a href="http://textuploader.com/discover">Discover</a></li>
<li><a href="http://textuploader.com/help">Help</a></li>
<li><a href="http://textuploader.com/developers">Developers</a></li>
<li><a href="http://textuploader.com/contact">Contact</a></li>
<li><a href='https://textuploader.com/profile'>My Account</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- header -->
<header>
<div class="container">
<div class="row">
<div class="span3">
<!-- <div class="main-logo"><a href="http://textuploader.com/"><img src="http://textuploader.com/assets/img/textuploader_logo.png" alt="TextUploader.com"></div> -->
<div class="main-logo"><a href='http://textuploader.com/'><img src="http://textuploader.com/assets/img/textuploader_logo.png" alt="TextUploader.com"></a></div>
</div>
<div class="span5">
<nav class="nav-icons">
<!-- small icons navigation -->
</nav>
</div>
<div class="span4">
<div class="user-box">
<div class="user-box-inner">
<img src="//www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=80&r=g&d=mm" class="user-avatar img-avatar" alt="Gravatar"/>
<div class="user-info">
<a href="https://textuploader.com/register">Create an Account</a> <ul class="unstyled">
<li><a href="https://textuploader.com/auth/login">Login</a></li>
<li>·</li>
<li><a href="https://textuploader.com/auth/password/forgot">Password</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- breadcrumbs -->
<div class="container">
<ul id="breadcrumbs">
<li>
<a href="http://textuploader.com/">
<i class="icon-home"></i>
</a></li>
<li><a href="http://textuploader.com/">Home</a></li>
<li><a href="http://textuploader.com/5jx4u">textuploader.com/5jx4u</a></li>
<li><span>Posted on: 11/16/15 1:59:00 AM UTC</span></li>
</ul>
</div>
<!-- main content -->
<div class="container">
<div class="row-fluid">
<div class="span12">
<div class="w-box w-box-blue">
<div class="w-box-header"><h4>"HPTjNRgUfG" - Views: 2 · Hits: 2 - Type: Public</h4></div>
<div class="w-box-content cnt_a ">
<div class="toolbar clearfix">
<div class="pull-left">
<div class="toolbar-icons clearfix">
<div style="overflow:hidden;width:90px;float:left;">
<div class="fb-like" data-href="http://textuploader.com/5jx4u" data-send="false" data-layout="button_count"
data-width="450" data-show-faces="false"></div>
</div>
<div style="overflow:hidden;width:90px;float:left;">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://textuploader.com/5jx4u">Tweet</a>
</div>
<div style="overflow:hidden;width:90px;float:left;">
<div class="g-plusone" data-size="medium" data-annotation="none"
data-href="http://textuploader.com/5jx4u"></div>
</div>
<div style="clear:both"></div>
</div>
</div>
<div class="pull-right">
<div class="btn-group">
<button class="btn btn-mini" onClick="parent.location='http://textuploader.com/5jx4u/rev'; void(0);">Revisions (0)</button>
<button class="btn btn-mini" onClick="parent.location='http://textuploader.com/contact'; void(0);">Report Abuse</button>
</div>
</div>
</div>
<pre><code class='no-highlight'>Please call back later <a href=" http://philadelphiaexplorers.org/about-the-explorers-club/#annual ">accidently took 2 40 mg paxil</a> "We need that flexibility," Fox said. "When you pick your offensive line, not just for the season, but for game day, you have to pick them from the standpoint of having some flexibility. You've got to have a swing guard/center, you've got to have a swing tackle/guard, for the games."
</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="footer_space"></div>
</div>
<!-- footer -->
<footer>
<div class="container">
<div class="row">
<div class="span8">
<div>© 2016 <a href="http://www.exsom.com" target="_blank">Exsom Group, LLC</a>. All Rights Reserved.</div>
</div>
<div class="span4">
<ul class="unstyled">
<!--
<li><a href="https://tuarmor.com">TUArmor</a></li>
<li>·</li>
-->
<li><a href="http://textuploader.com/terms-of-service">Terms of Service</a></li>
<li>·</li>
<li><a href="http://textuploader.com/privacy">Privacy Policy</a></li>
<li>·</li>
<li><a href="http://textuploader.com/dmca">DMCA</a></li>
<li>·</li>
<li><a href="http://status.textuploader.com/">System Status</a></li>
</ul>
</div>
</div>
</div>
</footer>
<!-- Common JS -->
<!-- jQuery framework -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- bootstrap Framework plugins -->
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0//js/bootstrap.min.js"></script>
<!-- top menu -->
<script src="http://textuploader.com/assets/js/jquery.fademenu.js"></script>
<!-- top mobile menu -->
<script src="http://textuploader.com/assets/js/selectnav.min.js"></script>
<!-- actual width/height of hidden DOM elements -->
<script src="http://textuploader.com/assets/js/jquery.actual.min.js"></script>
<!-- jquery easing animations -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<!-- power tooltips -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-powertip/1.1.0/jquery.powertip-1.1.0.min.js"></script>
<!-- date library -->
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/1.7.2/moment.min.js"></script>
<!-- common functions -->
<script src="http://textuploader.com/assets/js/beoro_common.js"></script>
<!-- twitter button code -->
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');</script>
<!-- +1 code -->
<script type="text/javascript">
(function () {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = '//apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>
我想要的只是这里的明文:
<pre><code class='no-highlight'>Please call back later <a href=" http://philadelphiaexplorers.org/about-the-explorers-club/#annual ">accidently took 2 40 mg paxil</a> "We need that flexibility," Fox said. "When you pick your offensive line, not just for the season, but for game day, you have to pick them from the standpoint of having some flexibility. You've got to have a swing guard/center, you've got to have a swing tackle/guard, for the games."
</code></pre>
我如何编写一个简单的代码来解析上面的“
" and "”之间的数据?
答案 0 :(得分:0)
如果需要,您可以使用Regex
抓住它。
尝试过&amp;经过测试
(?s)(<pre>.+?<\/pre>)
以上是可以使用的模式。如果您想确认,请参阅that here.
我没有告诉您如何在.net
中完成此操作,因为您没有向我们提供您尝试过的内容。我可以打破这种模式,但上面的链接已经做到了。