我試圖從一個網站的源代碼中取消鏈接,該鏈接隨着每個源代碼的不同而不同。如何從源代碼中刪除變量數據?
形式例如:
<div align="center">
<a href="http://www10.site.com/d/the rest of the link">
<span class="button_upload green">
下一次我得到的源代碼http://www10
更改任何http://www
+數字,如http://www65
。
我該如何使用新更改的號碼報廢確切鏈接?
編輯: 下面是我如何使用RE MatchCollection m1 = Regex.Matches(textBox6.Text, "(href=\"http://www10)(?<td_inner>.*?)(\">)", RegexOptions.Singleline);
你使用Html Parser嗎?像http://htmlagilitypack.codeplex.com/ – appl3r
@ appl3r我用正則表達式,但使用它,我不得不手動輸入每個新的數字 –