Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8219599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:13:31+00:00 2026-06-07T13:13:31+00:00

I am using a watin dll to browse through a webpage, click on a

  • 0

I am using a watin dll to browse through a webpage, click on a link in li tag, go to the next page, fetch some data, go back to previous page and click the link in the next li tag.

I am able to do this with one link in li tag. I want to get all the li tag underul <classname> click on each link and perform the above procedure. How can I get all the li and loop through each page?

HTML code of the page is like this:

<ul id="ul_classname" class="search-result-set">
    <li class="">
        <div class="Div_Classname">
            <h3 class="standard_font">
                <a class="a class_name" href="link to be clicked">text to be displayed</a>
            </h3>
            <p class="word-wrap"></p>
        </div>
    </li>
    <li class="">
        <div class="Div_Classname">
            <h3 class="standard_font">
                <a class="a class_name" href="link to be clicked">text to be displayed</a>
            </h3>
            <p class="word-wrap"></p>
        </div>
    </li>
</ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T13:13:34+00:00Added an answer on June 7, 2026 at 1:13 pm

    HTH!

    private void CrawlSite()
    {
        int idx = 0;
        do
        {
            idx = this.ClickLink(idx);
        }
        while (idx != -1);
    }
    
    private int ClickLink(int idx)
    {
        WatiN.Core.Browser browser = GetBrowser();
    
        ListItemCollection listItems = browser.List("ul_classname").ListItems;
        if (idx > listItems.Count - 1)
            return -1;
    
        Link lnk = listItems[idx].Link(Find.ByClass("a class_name"));
        lnk.Click();
    
        //TODO: get your data
    
        browser.Back();
    
        return idx + 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I navigate to the next page using WatiN ? I need to
I'm using Watin to automate download file from a website. At some point a
I am using Watin 2.0 to develop some automated UI tests. I cannot get
I've been working with sending and receiving email through various web-mail clients using WatiN,
I am using Watin to do some automated testing and I am running IE
I am using watin for some UI testing. In one of the testing, I
I'm using Specflow with NUnit and WatiN to do some acceptance testing, and all
Scraping a webpage, containing about 250 table divisions. Using WatiN and WatinCSSSelectors First I
I am writing automation scripts using WATIR and WATIN. Watir has something called page
Using WatiN, Im facing some issues with FireFox FF = new FireFox (http://www.google.com); ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.