[Closed] How to read a html file
Hi, I would want to read the html file with script or dotnet
get the source html code, not web browser,
For an example
from this page http://www.sonystyle.com.tw/index.html
I get 鈥?lt;html><body><h1>It works!</h1></body></html>鈥?/p>
I would want get some response from the google search page
thanks
I鈥?have try this in C#
but i have no idea how to transfer from C# to maxscript 🙁
using System;
using System.Collections.Generic;
using System.Text;
using WebPageFetchLibrary;
using System.Web;
namespace Spelling
{
public class Spell
{
private URLProcessing up = new URLProcessing();
public Spell()
{
}
public string strPossSpelling(string _strOriSpelling)
{
string strhtml = up.FetchURL(鈥?a href=”http://www.google.com/search?q” rel=”nofollow noopener”> http://www.google.com/search?q=鈥?+ _strOriSpelling);
int i, j;
strhtml = HttpUtility.HtmlDecode(strhtml);
i = strhtml.IndexOf(鈥渃lass=spell>鈥?;
i = strhtml.IndexOf(鈥渃lass=spell>鈥? i + 1);
i = strhtml.IndexOf(“<em>”, i + 1);
j = strhtml.IndexOf(“</em>”, i);
return strhtml.Substring(i + 4, j – i – 4);
}
}
}
I鈥檓 guessing you will need
"system.windows.forms.htmlDocument"
but I鈥檓 not sure how to use it at this point.