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

  • SEARCH
  • Home
  • 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 7874259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:45:37+00:00 2026-06-03T02:45:37+00:00

I have this piece of code: string x = textBox1.Text; string[] list = x.Split(‘;’);

  • 0

I have this piece of code:

string x = textBox1.Text;
string[] list = x.Split(';');
foreach (string u in list)
{
    string url = "http://*********/index.php?n=" + u;
    webBrowser1.Navigate(url);
    webBrowser1.Document.GetElementsByTagName("META");
}

and I’m trying to get the <META> tags to output to a message box, but when I test it out, I keep getting this error:

Object reference not set to an instance of an object.

  • 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-06-03T02:45:38+00:00Added an answer on June 3, 2026 at 2:45 am

    Your problem is that you’re accessing the Document object before the document has loaded – WebBrowsers are asynchronous. Just parse the HTML using a library like the HTML Agility Pack.

    Here’s how you might get the <meta> tags using the HTML Agility Pack. (Assumes using System.Net; and using HtmlAgilityPack;.)

    // Create a WebClient to use to download the string:
    using(WebClient wc = new WebClient()) {
        // Create a document object
        HtmlDocument d = new HtmlDocument();
    
        // Download the content and parse the HTML:        
        d.LoadHtml(wc.DownloadString("http://stackoverflow.com/questions/10368605/getelementsbytagname-in-c-sharp/10368631#10368631"));
    
        // Loop through all the <meta> tags:
        foreach(HtmlNode metaTag in d.DocumentNode.Descendants("meta")) {
            // It's a <meta> tag! Do something with it.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have writed this piece of code in java: String[] tokens = strLine.split(delims); SimpleOrderRequest
Let's suppose I have this piece of code. foreach(string value in myList) { string
I have this simple piece of code in c++: int main(void) { string text
I have this piece of code #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h>
I have this piece of code: $(#faq).click(function () { var url = $.get(faq, {
I have this small piece of code String[] words = {{apf,hum_,dkoe,12f}; for(String s:words) {
I have this piece of code and it's causing NullPointerException private List<Player> playerList; private
I have this piece of code: // Convert string to date object NSDateFormatter *dateFormat
I have this piece of code: foreach (ListItem item in lbUnassigned.Items) { if (item.Selected)
I have this piece of code in my java class mystring = mysuperstring.split(/); I

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.