take a text from a site

Jan 14, 2011 at 4:22 PM

hi all!

i am new with html agility pack..

i want to use it to take the main texts from some sites

for example this is one page that i want the main text

http://www.nba.com/lakers/news/110112_gameday_warriors.html

 

i want to take the text here..

 

"

OAKLAND, Calif. (AP)—Kobe Bryant had all of about six minutes left when he decided to finally take over. For him, it was plenty of time.

Bryant scored 17 of his 39 points in the final 5:49 and the sluggish Los Angeles Lakers rallied late to beat theGolden State Warriors 115-110 on Wednesday night for their sixth straight victory.

“It don’t matter who’s on me. When it’s go time, it’s go time,” Bryant said. “You have the responsibility to come through for your team and make the right play. Tonight, I did that.”

Bryant also assisted on Ron Artest’s crucial 3-pointer with 1:55 to play.Lamar Odom did his part to fuel the comeback, too, scoring 10 straight points during a key fourth-quarter stretch on the way to 20 points and nine rebounds.

.................................................

................................................

"

 

how can i do that??

i use vb.net

Jan 15, 2011 at 8:42 AM

is there a tutorial to read about html agility pack??

Jan 15, 2011 at 8:38 PM

There's no full tutorial but 4 Guys from Rolla just posted a good article

http://www.4guysfromrolla.com/articles/011211-1.aspx

Jan 15, 2011 at 10:09 PM

can you please give me an example in the case i posted??

i cannot understand how to use it..

 

Jan 16, 2011 at 3:39 AM

Vagelis29,

Perhaps this will help?

1.  Identify in the source file what tag the text sits in (is it a div? input? text? class? etc.)
2.  Look at this post to get some ideas on how to get the tag in question: http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=241662
3.  Look at my post in how I started to break down what I was seeking: http://htmlagilitypack.codeplex.com/Thread/View.aspx?ThreadId=241548

If you're only going to be doing this for one article (or the content format is always displayed the same from the source), you may want to try regular expressions (regex).  Jessie Liberty has a quick introduction on how to do this on www.silverlight.net:
http://www.silverlight.net/learn/videos/silverlight-4-videos/oob-screen-scraper/

Good luck!

Thor

Jan 16, 2011 at 7:24 AM

thank you for your time!

perhaps i want an example in something bigger to understand

i dont want to do that only for one article

for example here how can i take only the main text in string or somehow else

 

<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td colspan="5"> <iframe  id='nbaTeamArticlePlayer201111525012' name='nbaTeamArticlePlayer201111525012' src='http://www.nba.com/video/cvp/teamarticleplayer.html?videoID=/video/games/lakers/2011/01/14/0021000586_njn_lal_recap.nba&width=576&height=324' width='576' height='404' frameBorder='0' scrolling='no'><p>Your browser does not support iframes.</p></iframe></td>
     </tr>
   <tr>
     <td><div class='vidPlaylistThumbnails'>
<a class='vidPlaylistThumbnailsLink' href="javascript:{}" onclick="frames['nbaTeamArticlePlayer201111525012'].playVideo('video/games/lakers/2011/01/14/0021000586_njn_lal_recap.nba', videoPlaylist201111525012);return false;">
<img  src='http://i2.cdn.turner.com/nba/nba/video/games/lakers/2011/01/14/0021000586_njn_lal_recap.nba.70x53.jpg'/>
</a>
</div></td>
     <td><div class='vidPlaylistThumbnails'>
<a class='vidPlaylistThumbnailsLink' href="javascript:{}" onclick="frames['nbaTeamArticlePlayer201111525012'].playVideo('video/teams/lakers/2011/01/15/110113netskobebryant-1524098', videoPlaylist201111525012);return false;">
<img  src='http://i.cdn.turner.com/nba/nba/video/teams/lakers/2011/01/15/110113netskobebryant-1524098-nba4-10.jpg'/>
</a>
</div></td>
     <td>
<div class='vidPlaylistThumbnails'>
<a class='vidPlaylistThumbnailsLink' href="javascript:{}" onclick="frames['nbaTeamArticlePlayer201111525012'].playVideo('video/teams/lakers/2011/01/15/011411JacksonPostgame-1524096', videoPlaylist201111525012);return false;">
<img  src='http://i.cdn.turner.com/nba/nba/video/teams/lakers/2011/01/15/011411JacksonPostgame-1524096-nba4-3.jpg'/>
</a>
</div></td>
     <td><div class='vidPlaylistThumbnails'>
<a class='vidPlaylistThumbnailsLink' href="javascript:{}" onclick="frames['nbaTeamArticlePlayer201111525012'].playVideo('video/teams/lakers/2011/01/15/110113netslamarodom-1524097', videoPlaylist201111525012);return false;">
<img  src='http://i.cdn.turner.com/nba/nba/video/teams/lakers/2011/01/15/110113netslamarodom-1524097-nba4-10.jpg'/>
</a>
</div></td>
     <td><div class='vidPlaylistThumbnails'>
<a class='vidPlaylistThumbnailsLink' href="javascript:{}" onclick="frames['nbaTeamArticlePlayer201111525012'].playVideo('video/teams/lakers/2011/01/15/110113netsespanol-1524101', videoPlaylist201111525012);return false;">
<img  src='http://i.cdn.turner.com/nba/nba/video/teams/lakers/2011/01/15/110113netsespanol-1524101-nba4-8.jpg'/>
</a>
</div></td>
   </tr>
 </table>
 
 
<div class='vidPlaylistSelect'>
 
 
 
 
</div>
<!-- ###### EMBED VIDEO PLAYLIST CODE END ###### -->
<p><strong><font size="+1">Lakers hold off Nets for 7th straight win</font></strong>        </p>
<h4>By GREG BEACHAM</h4>
<p>LOS ANGELES (AP) Kobe Bryant scored 27 points, Pau Gasol had 20 points and nine rebounds, and the Los Angeles Lakers hung on for their seventh straight victory, 100-88 Friday night over the New Jersey Nets.</p>
<p>Lamar Odom had 14 points and 11 rebounds as the Lakers extended the NBA's longest active winning streak despite never shaking the struggling Nets, who got 35 points from Brook Lopez in their ninth loss in 10 games.</p>
<p>Sasha Vujacic scored 17 points and Jordan Farmar had 12 in both reserve guards' return to Staples Center with New Jersey after winning two titles with the Lakers.</p>
<p>Ron Artest scored 14 points for Los Angeles, which has been perfect since an embarrassing blowout loss to Memphis at home on Jan. 2, its fourth defeat in six games.</p>
<p>Shannon Brown added 12 points for the Lakers, who have won their last seven games in just 11 days during a brutal scheduling stretch that doesn't include consecutive days off until Jan. 22-23.</p>
<p>Farmar left as a free agent last summer, saying his talents didn't fit the triangle offense and believing he could be a starter elsewhere in the NBA. Vujacic was traded to New Jersey last month after essentially losing his job as Bryant's backup to Brown.</p>
<p>Farmar and Vujacic both took big roles in the second half, with Vujacic's 3-pointer pulling New Jersey within two at 78-76 with 7 1/2 minutes to play. The Lakers responded with nine consecutive points capped by Bryant's three-point play with 5:23 left.</p>
<p>Bryant and Derek Fisher presented Farmar's second ring to the Los Angeles native during a brief pregame ceremony, but he got almost no cheers when he checked into the game. Vujacic was greeted with a bit more warmth, but both guards were booed regularly by the Los Angeles crowd in the second half while they kept the Nets close.</p>
<p>Vujacic played the entire game in overdrive, taking 16 shots but going just 2 for 9 on 3-pointers.</p>
<p>The Lakers limited Devin Harris to six points - more than 10 below his average - as the Nets lost their fourth straight game on the second stop of a four-game West Coast trip. New Jersey has lost seven straight to the Lakers.</p>
<p>Lopez's 13 first-quarter points put the Nets ahead early, but Bryant replied with 13 of his own. Los Angeles' dominant 7-foot duo had rare early struggles, with Gasol scoring just two points until late in the second quarter and Andrew Bynum committing two early fouls.</p>
<p>Bynum finished with just two points and five rebounds in 22 minutes, although he swatted a layup attempt by Farmar into the second row behind the basket during the fourth quarter.</p>
<p>Lopez missed a dunk in the final minute, leaving him one shy of his season high in points.</p>
<p>NOTES: Kris Humphries had six points and 15 rebounds for the Nets, but also whacked Gasol in the side of the face under the basket in the final minutes. Gasol got up slowly with a welt near his left eye, but made two free throws. ... Odom went 5 for 11 from the free throw line, driving down his unimpressive percentage in an otherwise stellar year. He also got a technical foul with 1:06 to play. ... Fans near courtside included WBC welterweight champion Andre Berto, Zac Efron, Robert Wuhl and producer Brian Grazer. Tom Petty and his wife, Dana, used the seats normally occupied by Jack Nicholson, who was raised in Neptune, N.J.</p>
<p> </p>
<p> </p>
<br>
        Copyright 2010 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited</td>

<td width="360" align="center" valign="top" bgcolor="#EFEFEF"><a href="http://www.nba.com/allstar2011/asb/eng/landing.jsp?referrer=asb11_lal&cid=nba330"><img src="http://www.nba.com/lakers/photos/1011gameday_voteasw.jpg" border="0"></a><img src="http://www.nba.com/lakers/media/1011gamedaybasketblogright.jpg" width="350" height="33"><br>
        <table width="350" border="0" cellspacing="5" cellpadding="5">
          <tr>
            <td align="left" valign="middle"><ul>
              <li><a href="http://blog.lakers.com/lakers/2011/01/14/lakers-100-nets-88-jan-14-running-diary/" title="Lakers 100, Nets 88: Jan. 14 Running Diary">Lakers 100, Nets 88: Jan. 14 Running Diary</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/14/farmar-vujacic-return-to-los-angeles/" title="Farmar, Vujacic Return to Los Angeles">Farmar, Vujacic Return to Los Angeles</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/13/matt-barnes-jan-13-injury-update/" title="Matt Barnes: Jan. 13 Injury Update">Matt Barnes: Jan. 13 Injury Update</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/13/theo-ratliff-jan-13-injury-update/" title="Theo Ratliff: Jan. 13 Injury Update">Theo Ratliff: Jan. 13 Injury Update</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/13/photo-young-kobe-bryant-in-italy/" title="Photo: Young Kobe Bryant in Italy">Photo: Young Kobe Bryant in Italy</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/13/fourth-all-star-returns-2/" title="Fourth All-Star Returns">Fourth All-Star Returns</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/12/lakers-115-warriors-110-jan-12-diary/" title="Lakers 115, Warriors 110: Jan. 12 Running Diary">Lakers 115, Warriors 110: Jan. 12 Running Diary</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/12/lakers-warriors-podcast-preview/" title="Lakers – Warriors Podcast Preview">Lakers – Warriors Podcast Preview</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/11/lakers-112-cavs-57-jan-11-running-diary/" title="Lakers 112, Cavs 57: Jan. 11 Running Diary">Lakers 112, Cavs 57: Jan. 11 Running Diary</a></li>
              <li><a href="http://blog.lakers.com/lakers/2011/01/10/bynums-second-t-rescinded/" title="Bynum's Second T Rescinded">Bynum's Second T Rescinded</a></li>
            </ul></td>
          </tr>
        </table>