Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using HtmlAgilityPack;
- using System.Net;
- using System.IO;
- using System.Text.RegularExpressions;
- namespace spider
- {
- class Program
- {
- static void Main(string[] args)
- {
- string s;
- string pattern = @"\w";
- WebClient url = new WebClient();
- MemoryStream ms = new MemoryStream(url.DownloadData("https://translate.google.cn/translate_a/single?client=gtx&sl=zh-TW&tl=en&dt=t&q=我愛你"));
- HtmlDocument doc = new HtmlDocument();
- doc.Load(ms,Encoding.UTF8);
- string result = doc.ParsedText;
- Console.WriteLine(result);
- /*
- foreach(Match match in Regex.Matches(result, pattern))
- {
- Console.Write(match.Value);
- }*/
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment