Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:37:49+00:00 2026-05-25T13:37:49+00:00

I have a web page that when navigated to only returns a simple text

  • 0

I have a web page that when navigated to only returns a simple text value, like the number 100. I need to grab that value from the page, so I can use it in my application. The application is a simple Windows Forms app, with a web browser control on it.

I have tried numerous things, but it’s not grabbing the text, as if it doesn’t exist. Yet if I right click and view source, it’s there.

This can’t be that difficult…It’s just some text.

Just to clarify the document contains NO html, only a number. When using WebClient or WebRequest, it doesn’t return the value.

    private void RegisterWindow_Load(object sender, EventArgs e)
    {
        webBrowser1.Navigate("MYURL");
        webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

    }

    void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        // Check and see if we have navigated to the final page.
        string registeredUrl = "MYURL";
        string currentPage = webBrowser1.Url.ToString();
        string response = string.Empty;

        if (webBrowser1.Url.ToString() == registeredUrl)
        {
            // Now parse the authkey from the url
            response = GetWebRequest(currentPage);
            MessageBox.Show(response);
        }
    }

    /// <summary>
    /// Send a Web Request and get a Web Response back. 
    /// This respons can be a valid URL, simple text response, or 
    /// HTML response.        
    /// </summary>
    /// <param name="url"></param>
    /// <returns></returns>
    public string GetWebRequest(string url)
    {
        var client = new WebClient();
        var content = client.DownloadString(url);

        return content;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:37:49+00:00Added an answer on May 25, 2026 at 1:37 pm

    If the document contains only number without any HTML, this should work:

    public string GetWebRequest()
    {
        return webBrowser1.Document.Body.InnerText;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple web page that till now didn't need any login. It
Let's say I have a web page that currently accepts a single ID value
I have an ASP.NET web page that displays a variety of fields that need
I have a web page that includes a bunch of images. Sometimes the image
I have a web page that displays a long line graph inside a div
I have a web page that is being displaying in a winform app using
I have a web page that renders the same in IE7, Firefox, and Safari
I am working on a web page that is using jQuery. I have an
I have a web page with DIV s with a mouseover handler that is
I have a BasePage which inherits from System.Web.UI.Page , and every page that inherits

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.