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.
VAL1NAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.