2011-04-05 49 views
0

我有問題,此下面的腳本生成電子郵件地址加載頁面時,我想分析該電子郵件我該怎麼做?從腳本Html敏捷包獲取出來

tr> 
    <td align='right' class='generalinfo_left' >Email Address:</td> 
    <td class='generalinfo_right'><script type="text/javascript"> 

//<![CDATA[  
var o3752aaa9bb29d904adeb88838117fd7c = String.fromCharCode(109);var f03de7e643c296e211edddbc3197b33f6 = String.fromCharCode(97);var k7c3bf82468602c0f8dff4950e4b6ff1e = String.fromCharCode(105);var b3eaa633e44451be8df1fa47d75149934 = 'l';var ma2fa16c3a3f532b780aaf0fa5a5b75c6 = 't';var re0c13fc69c03925782867a0540f8c084 = 'o';var j335f1365672123d1fcaf9a83b76f1b7b = String.fromCharCode(58);var f32820e1c54cbc3fa0d418cd1c195eaec = String.fromCharCode(105);var y8c24ea00a7a1edf1c01f794d487697e3 = String.fromCharCode(110);var bcc0ad4f628e703f9ff6e25b87b77ec34 = 'f';var c985c961c7ee85fe6a25d5a66fb421745 = String.fromCharCode(111);var z5ab4e3bdc353d621cea5babcc5dca417 = String.fromCharCode(64);var s4e087167cd0bac466344e72016511172 = String.fromCharCode(97);var re26f6ae180723793af62bc36d5ab2530 = String.fromCharCode(108);var ye1b53d01de118079a38de5e951586731 = 'c';var g9fc5710c9266ce08afbe4da24702dfdd = String.fromCharCode(105);var k5cd5ea1bac40fdbb8b133b7e356809c6 = String.fromCharCode(118);var fcd6e4771e956e270c6897d24ca51c256 = String.fromCharCode(97);var y9d7854a5921fa2be88c8cd72c7e2884e = String.fromCharCode(114);var xa58bea1ecad6fe7d2c736aab1df2df44 = '.';var e4569f6c98804675f7117a84abb0b8d5c = 'c';var o4d2081e2344020922dcb924690c9972e = 'o';var af150185e5eef8ecd8dc1b0a4977c7d55 = String.fromCharCode(109);document.write("<a href='" + o3752aaa9bb29d904adeb88838117fd7c + f03de7e643c296e211edddbc3197b33f6 + k7c3bf82468602c0f8dff4950e4b6ff1e + b3eaa633e44451be8df1fa47d75149934 + ma2fa16c3a3f532b780aaf0fa5a5b75c6 + re0c13fc69c03925782867a0540f8c084 + j335f1365672123d1fcaf9a83b76f1b7b + f32820e1c54cbc3fa0d418cd1c195eaec + y8c24ea00a7a1edf1c01f794d487697e3 + bcc0ad4f628e703f9ff6e25b87b77ec34 + c985c961c7ee85fe6a25d5a66fb421745 + z5ab4e3bdc353d621cea5babcc5dca417 + s4e087167cd0bac466344e72016511172 + re26f6ae180723793af62bc36d5ab2530 + ye1b53d01de118079a38de5e951586731 + g9fc5710c9266ce08afbe4da24702dfdd + k5cd5ea1bac40fdbb8b133b7e356809c6 + fcd6e4771e956e270c6897d24ca51c256 + y9d7854a5921fa2be88c8cd72c7e2884e + xa58bea1ecad6fe7d2c736aab1df2df44 + e4569f6c98804675f7117a84abb0b8d5c + o4d2081e2344020922dcb924690c9972e + af150185e5eef8ecd8dc1b0a4977c7d55 + "'>" + f32820e1c54cbc3fa0d418cd1c195eaec + y8c24ea00a7a1edf1c01f794d487697e3 + bcc0ad4f628e703f9ff6e25b87b77ec34 + c985c961c7ee85fe6a25d5a66fb421745 + z5ab4e3bdc353d621cea5babcc5dca417 + s4e087167cd0bac466344e72016511172 + re26f6ae180723793af62bc36d5ab2530 + ye1b53d01de118079a38de5e951586731 + g9fc5710c9266ce08afbe4da24702dfdd + k5cd5ea1bac40fdbb8b133b7e356809c6 + fcd6e4771e956e270c6897d24ca51c256 + y9d7854a5921fa2be88c8cd72c7e2884e + xa58bea1ecad6fe7d2c736aab1df2df44 + e4569f6c98804675f7117a84abb0b8d5c + o4d2081e2344020922dcb924690c9972e + af150185e5eef8ecd8dc1b0a4977c7d55 + "</a>") 

//]]>; 

</script></td> 

放出來就是這個樣子

<td class="generalinfo_right"> 
<script type="text/javascript"> 
same above script plus following Line 
</script><a href="mailto:[email protected]">[email protected]</a></td> 
+0

這需要什麼? – user492238 2011-04-05 06:33:36

+0

此腳本應該生成電子郵件,但爲什麼html敏捷包顯示此腳本而不生成電子郵件 – 2011-04-05 06:42:27

+0

該腳本旨在防範垃圾郵件。仍然想知道,爲什麼你應該嘗試解決它?如果該網站不希望您收集這些數據,請考慮讓他們採用不太可疑的方式。 – user492238 2011-04-05 06:45:23

回答

0

我寫我自己的自定義解析器會讀劇本和解析電子郵件從it.here那張代碼

如果這個代碼可以優化或可以更工整請讓我知道

private string ReadEmail(string EmailScript) 
{ 
    string EncriptedEmail = ""; 
    string dataPart = ""; 
    dataPart = EmailScript.Substring(0, EmailScript.IndexOf("document.write")).Replace("//<![CDATA[\r", "").Replace("\"", "").Replace("\r\n",""); 
    EncriptedEmail = EmailScript.Replace("\"",""); 
    EncriptedEmail = EncriptedEmail.Substring(EncriptedEmail.IndexOf("'> + "), EncriptedEmail.IndexOf(" + </a>") - EncriptedEmail.IndexOf("'> +")).Replace("'> +", "").Trim(); 
    string[] requiredVariables = EncriptedEmail.Split('+'); 
    List<string> ExtractedDataFromRaw = new List<string>(); 
    string email = ""; 
    foreach (string variable in requiredVariables) 
    { 
    string temp = dataPart.Substring(dataPart.IndexOf(variable),dataPart.Length-dataPart.IndexOf(variable)).Replace(" ",""); 
    string tempValueofVariable = temp.Substring(0, temp.IndexOf(";")); 
    tempValueofVariable = tempValueofVariable.Substring(tempValueofVariable.IndexOf("="), tempValueofVariable.Length - temp.IndexOf("=")).Replace("=",""); 
    if (tempValueofVariable.Contains("String.fromCharCode")) 
    { 
     tempValueofVariable = GetCharacterFromASCII(tempValueofVariable.Replace("String.fromCharCode(", "").Replace(")", "")); 
    } 
    ExtractedDataFromRaw.Add(tempValueofVariable.Replace("'","")); 
    email += tempValueofVariable.Replace("'", ""); 
    } 
    return email; 
} 
private string GetCharacterFromASCII(string value) 
{ 
    int result = 0; 
    int.TryParse(value, out result); 
    return char.ConvertFromUtf32(result); 
} 
-1

該代碼是建立在從字符碼點時間的電子郵件地址一個字符,然後再組裝它。我想這是爲了防止垃圾郵件。取決於你需要做什麼,最簡單的方法就是使用jQuery或者其他的東西從鏈接中提取電子郵件地址。 $('a [href^= mailto]')。attr('href')。substring(7)或其他東西應該這樣做。

+0

我使用c#桌面應用程序,我們可以讓jqury在那裏工作 – 2011-04-05 06:44:41