Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in this site have a "td" element that include songs like:


01. Jorge & Mateus – O Que É Que Tem (Ao Vivo)
02. Luan Santana – Te Vivo
03. Thiaguinho – As Aparências Enganam
04. Victor & Leo – Na Linha do Tempo
so when i do web.DownloadString("http://www.maxalbums.com/album/V.A./HITS+PARA+NAMORAR.html");
i not get the entire text
please help!
click to see

http://www.maxalbums.com/album/V.A./HITS+PARA+NAMORAR.html
Posted
Comments
Ravi Bhavnani 25-Jul-14 18:19pm    
Remember, you won't be able to download content that's injected into the DOM via JavaScript or by making AJAX requests after the page has loaded, by simply making a call to WebClient.DownloadString().

/ravi
Member 10631195 25-Jul-14 18:23pm    
i jast wont to take element from table onces i And I do not see the songs in the string I got

Ravi Bhavnani 25-Jul-14 18:30pm    
That content should definitely be present in your string, starting at the substring:

<div Style="height:250px; overflow:auto; scrollbar-face-color:blue" >

/ravi
Member 10631195 25-Jul-14 18:33pm    
I will try just a second
Member 10631195 25-Jul-14 18:37pm    
not found the --><div Style="height:250px; overflow:auto; scrollbar-face-color:blue" >
in my string

1 solution

You can get at content injected by JavaScript by loading the page in a (hidden) WebBrowser control, wait for it to finish loading (see events exposed by WebBrowser), and then access its document text property.

You could also use Gecko to do this.  See this[^] SO answer for a link.

/ravi
 
Share this answer
 
Comments
Member 10631195 25-Jul-14 19:10pm    
I dosent have the WebBrowser contros in the webService
Ravi Bhavnani 25-Jul-14 19:26pm    
In that case, you'll need to inspect the JavaScript that's injecting the content (most likely by making an AJAX call) into the page and make that call from your webservice to get that data.

I recommend using Fiddler or Chrome's Developer Tools window (press F12 to show it, then press F5 to reload the page and watch the network traffic).

/ravi
Member 10631195 25-Jul-14 19:33pm    
First of all thank you very much for the help
second - I think how to do it I thought about what you said but it does not fit in my head that I have requests are carried out of the loop

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900