Grasshopper

algorithmic modeling for Rhino

hi,

does anybody know a way to read the html code from a web page?

I´ve tried these two in a c# component but no way:


string websiteContent = ReadURL("http://www.google.es/");
A = processHTMLCode(websiteContent);

and:

string url ="http://www.google.es/";
string result = null;

    try
    {
      WebClient client = new WebClient();
      result = client.DownloadString(url);
    }
    catch (Exception ex)
    {
      // handle error
      MessageBox.Show(ex.Message);
    }
    A = result;



thanks!

Views: 1449

Replies to This Discussion

Works fine here:

private void RunScript(string url, ref object A)
{
   System.Net.WebClient client = new System.Net.WebClient();
   A = client.DownloadString(url);
}



--
David Rutten
david@mcneel.com
Poprad, Slovakia
great!

thanks a lot, david

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service