ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!

Cracked.to | Best Forum Around | Free Premium Accounts




 392

[C#] Need help on parsing from a Website

by Stortex - 1 year ago
This post is by a banned member (Stortex) - Unhide
Stortex  
Supreme
58
Rep
1.668
Likes
Posts: 239
Threads: 92
Joined: Apr 2019
Vouches: 0
Credits: 5.809
Two Factor Authentication100 ReputationLeakgodSupreme
1 Year of service
Hello i want to make an Account generator for that i need to get data from a webstie to insert into the other one.
So i use an Webbrowser where i want to parse from but i dont know how....

Website (https://www.fakenamegenerator.com/advanced.php)
And i want to get things like phone number name and so on as an string.

Also it would be nice if someone can tell me how to set the range slider to a certain number and so on.

Thank you
:fiesta:
If you want to contact me write me a pm or add me on Discord!
 
[Image: X8IOUPJ.gif]
 
If you like my work why dont leave a like

Discord UID: 236853940396883969
This post is by a banned member (Stortex) - Unhide
Stortex  
Supreme
58
Rep
1.668
Likes
Posts: 239
Threads: 92
Joined: Apr 2019
Vouches: 0
Credits: 5.809
Two Factor Authentication100 ReputationLeakgodSupreme
1 Year of service
#2
This is a bump
If you want to contact me write me a pm or add me on Discord!
 
[Image: X8IOUPJ.gif]
 
If you like my work why dont leave a like

Discord UID: 236853940396883969
This post is by a banned member (Plot) - Unhide
Plot  
Coder
254
Rep
2.832
Likes
Posts: 353
Threads: 120
Joined: Apr 2019
Vouches: 14
Credits: 1.200
Two Factor AuthenticationMember UpgradeAddicted100 ReputationCredit CardLeakgodExclusive ReleaseInfinity
1 Year of service
#3
(This post was last modified: 1 year ago by Plot.)
Instead of using a web browser, you can use a WebClient, e.g:

Note: it will download the source of the website

Code:
string data = new WebClient().DownloadString("https://www.fakenamegenerator.com/advanced.php").ToString();
// After, you can use Regex to get the data you want
[Image: branding.png]
This post is by a banned member (hoaisonbk) - Unhide
hoaisonbk  
Registered
0
Rep
0
Likes
Posts: 35
Threads: 0
Joined: Jul 2019
Vouches: 0
Credits: 0
1 Year of service
#4
Quote:public string GetHtmlFromUrl(string url)
        {
            string result = "";
            HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
            httpWebRequest.AutomaticDecompression = DecompressionMethods.GZip;
            using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse())
            {
                using (Stream responseStream = httpWebResponse.GetResponseStream())
                {
                    using (StreamReader streamReader = new StreamReader(responseStream))
                    {
                        result = streamReader.ReadToEnd();
                    }
                }
            }
            return result;
        }

This is my code download source from url. It worked!  :feelsgood:

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)