• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

VB.NET PARSE HTML CONTENT

Hi, I have a list of items that are randomly generated by the server each time the page is accessed.

EXAMPLE:

      <li><a href="http://www.mysite.com/catalog/default.php?cPath=62">MAINCAT1</a></li>
      <ul>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=428">SUBCAT1 OF MAINCAT</a></li>
         <ul>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=127">Subitem 1 of SUBCAT1 of MAINCAT1</a></li>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=131">Subitem 2 of SUBCAT1 of MAINCAT1</a></li>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=135">Subitem 3 of SUBCAT1 of MAINCAT1</a></li>
         </ul>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=405">SUBCAT2 OF MAINCAT</a></li>
         <ul>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=406">Subitem 1 of SUBCAT2 of MAINCAT1</a></li>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=407">Subitem 2 of SUBCAT2 of MAINCAT1</a></li>
         </ul>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=128">SUBCAT3 OF MAINCAT1</a></li>
      </ul>
      <li><a href="http://www.mysite.com/catalog/default.php?cPath=63">MAINCAT2</a></li>
      <ul>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=191">SUBCAT1 OF MAINCAT2</a></li>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=326">SUBCAT2 OF MAINCAT2</a></li>
         <li><a href="http://www.mysite.com/catalog/default.php?cPath=277">SUBCAT3 OF MAINCAT2</a></li>
         <ul>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=391">Subitem 1 of SUBCAT3 of MAINCAT2</a></li>
            <li><a href="http://www.mysite.com/catalog/default.php?cPath=390">Subitem 2 of SUBCAT3 of MAINCAT2</a></li>
         </ul>
      <ul>

Open in new window


So, now I need the program to:

Remember main category (for example: MAINCAT1), then go to url mysite.com/addcategory.php?id=MAINCAT1

Once it's done, it then has to search for stuff within that category.
Example: SUBCAT1 OF MAINCAT

It should then got to: mysite.com/addsubcat.php?subcat=SUBCAT1 OF MAIN CAT1&maincat=MAINCAT1

Then, it should find sub cats of "SUBCAT1 OF MAINCAT" if there are any and go to:
mysite.com/addsubitem?subitem=Subitem 1 of SUBCAT1 of MAINCAT1&subcat=SUBCAT1 OF MAINCAT&maincat=MAINCAT

Thank you.
0
VAL1N
Asked:
VAL1N
1 Solution
 
Bob LearnedCommented:
If you need to parse HTML, then I would look at the HTML Agility Pack.

Html Agility Pack
http://htmlagilitypack.codeplex.com/releases/view/44954
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now