New & collection expression can be simplified.
This commit is contained in:
@@ -6,9 +6,9 @@ namespace lottery_co_uk_scraper.Utilities
|
|||||||
{
|
{
|
||||||
public static async Task<List<string>> ExtractUrlsAsync(string url)
|
public static async Task<List<string>> ExtractUrlsAsync(string url)
|
||||||
{
|
{
|
||||||
List<string> urls = new List<string>();
|
List<string> urls = [];
|
||||||
|
|
||||||
using (HttpClient client = new HttpClient())
|
using (HttpClient client = new())
|
||||||
{
|
{
|
||||||
string content = await client.GetStringAsync(url);
|
string content = await client.GetStringAsync(url);
|
||||||
MatchCollection matches = MyRegex().Matches(content);
|
MatchCollection matches = MyRegex().Matches(content);
|
||||||
@@ -24,6 +24,7 @@ namespace lottery_co_uk_scraper.Utilities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
urls.Reverse();
|
||||||
|
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user