C
C#3y ago
Legion

❔ Getting Info From HTML File

Hi guys i have a simple ish question. so i have this Steam Collection file link: https://steamcommunity.com/sharedfiles/filedetails/?id=2892539040 From here i can see HTML via view Source. And that is all fine i got that hole HTML file saved in a single string like this Code:
Console.WriteLine("Please input the steam collection page:");
string url = Console.ReadLine();
if (IsSteamPage(url))
{
using (WebClient client = new WebClient())
{
string content = client.DownloadString(url);
}
}
else
{
Console.WriteLine("Its not Steam Page.");
}
Console.ReadLine();
Console.WriteLine("Please input the steam collection page:");
string url = Console.ReadLine();
if (IsSteamPage(url))
{
using (WebClient client = new WebClient())
{
string content = client.DownloadString(url);
}
}
else
{
Console.WriteLine("Its not Steam Page.");
}
Console.ReadLine();
As you can see hole HTML file is saved in a single string called content. That is all Fine but from there i need to extract info like this:
<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2732407704"><div class="workshopItemTitle">[Reworked] Madax Weapon Pack</div></a>
<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2732407704"><div class="workshopItemTitle">[Reworked] Madax Weapon Pack</div></a>
there are lines like this one above and i would like to get all the Mods names and steam links as well as their id in this example the id is 2732407704. I know its a simple string manipulation but i am stuck and if anybody know how i can solve this pls do tell and ty very mutch for helping in advance.
Steam Workshop::GIF
Steam Workshop: Project Zomboid.
2 Replies
Angius
Angius3y ago
HtmlAgilityPack package is recommended for parsing HTML Also, can you not just use Steam's API?
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?