1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| Dim pattern As String = ""
'on récupère tous les a href
pattern = "<a\s+[^>]*?href\s*=\s*(?:(?:""(?<url>[^""]*)"")|(?<url>[^>]*))"
Dim r As New Regex(pattern, (RegexOptions.IgnoreCase Or RegexOptions.Compiled))
Dim results As MatchCollection
results = r.Matches(PageContent)
For Each mat As Match In results
Dim g As Group = mat.Groups(1)
Dim cc As CaptureCollection = g.Captures
For Each c As Capture In cc
'Traitement
Next
Next
'on récupère tous les area href
pattern = "<area\s+[^>]*?href\s*=\s*(?:(?:""(?<url>[^""]*)"")|(?<url>[^>]*))"
r = New Regex(pattern, (RegexOptions.IgnoreCase Or RegexOptions.Compiled))
results = r.Matches(PageContent)
For Each mat As Match In results
Dim g As Group = mat.Groups(1)
Dim cc As CaptureCollection = g.Captures
For Each c As Capture In cc
'Traitement
Next
Next
'on récupère tous les css href
pattern = "<link\s+[^>]*?href\s*=\s*(?:(?:""(?<url>[^""]*)"")|(?<url>[^>]*))"
r = New Regex(pattern, (RegexOptions.IgnoreCase Or RegexOptions.Compiled))
results = r.Matches(PageContent)
For Each mat As Match In results
Dim g As Group = mat.Groups(1)
Dim cc As CaptureCollection = g.Captures
For Each c As Capture In cc
'Traitement
Next
Next
'on récupère tous les img src
pattern = "<img\s+[^>]*?src\s*=\s*(?:(?:""(?<url>[^""]*)"")|(?<url>[^>]*))"
r = New Regex(pattern, (RegexOptions.IgnoreCase Or RegexOptions.Compiled))
results = r.Matches(PageContent)
For Each mat As Match In results
Dim g As Group = mat.Groups(1)
Dim cc As CaptureCollection = g.Captures
For Each c As Capture In cc
'Traitement
Next
Next |
Partager