Click here to Skip to main content
16,011,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I need save to file User Names from this web: http://worldoftanks.eu/community/clans/500027296-BERU/#wot&mt_order_by=-name

I have tried this with WebClient, WebBrowser, SHDocVw.WebBrowser etc. and nothing work because in downloaded html page code has not filled that informations, what I need. As I undersrand they are showing via AJAX or somethig like this.

WebBrowser has method ShowSaveAsDialog, but I need WITHOUT this dialog

Could someone help me?

P.S. Sorry for my bad english.
Posted
Comments
ridoy 10-Nov-13 7:33am    
trigger an event that could perform like Ctrl+C and Ctrl+V.
OriginalGriff 10-Nov-13 7:41am    
Don't post the same question in multiple places:
http://www.codeproject.com/Messages/4698227/Save-displayed-text-from-Web-Page-in-Csharp.aspx
It's rude and it wastes effort.
Bear in mind it is a Sunday, and most of the western world is not at work. Have a little patience!
Abhinav S 10-Nov-13 7:55am    
Repost from the forums section.

1 solution

It does not matter if they use Ajax or something else. If the information you need is ever provided and can be seen in any other way, you can do the same in your code.

Or, maybe, you cannot, just because of one your problem: you are using try-and-error approach instead of trying to understand how things works. Such approach is utterly inefficient. I can see it by "WebBrowser" and "SHDocVw.WebBrowser" — browser components can be used, but are irrelevant to the problem. Using WebClient would make perfect sense, but the more universal tool is the class System.Net.HttpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^].

This is all you may possibly need. See also my past answers:
How to get the data from another site[^],
get specific data from web page[^].

[EDIT]

I found that the problem is somewhat more difficult. Please see my comment below, about possible Ajax use.

Here is some very different advice: find out and install some plug-in which works as the "HTTP spy". I, for example, use a Mozilla browser (Seamonkey, or you can use Firefox), and my plug-in is called HttpFox. Enable and start it. Then load you page. Wait until the list you need is show. Stop the plug-in. See all the requests and resources downloaded. Using HTTP requests provided, download them all. Find out in which one your data resides.

I just tried it, it shows a good hundred of downloaded items for just one page you referenced. Loot at them, find out where your data is.

Do the same thing in on step, using the code you already have. I will be a considerable shortcut in your work.

—SA
 
Share this answer
 
v3
Comments
triXerr 10-Nov-13 12:54pm    
Via WebClient or HttpWebRequest I cant download necessary data. Because in downloaded string are not that data (User Names) from Web Page :(
Sergey Alexandrovich Kryukov 10-Nov-13 12:58pm    
This is a matter of particular Web page. Is this data accessible if you do it throw a Web browser? IF it is, you can do it in code. If not, it is not available to you. As simple as that.
—SA
triXerr 10-Nov-13 13:15pm    
Yes, When I will Navigate that page in WebBrowser, then I can see that data.
Sergey Alexandrovich Kryukov 10-Nov-13 13:56pm    
Great. It means that you should do exactly the same sequence of requests programmatically. Do you have to authenticate? Then you need to do it, too.

As I can see, the URL you provided does not show anything, you also need to click on something. When you click, this is another URL, you should request it. Or it can be some JavaScript, at it will eventually redirect you to where you should find the information you need. Then you should look at this JavaScript and see what it does. And so on...

—SA
triXerr 10-Nov-13 14:19pm    
If it is correct... filling that table wich contains User Name, etc. doing this script: http://worldoftanks.eu/static/3.15.0.4/clans/js/helper_members.js

But I'm not able to analyze it, because I never work with JavaScript or whatever is it.

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



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