Run a Loop number of rows time present in webpage in selenium basic, Excel ABA

mmbhatti

New Member
Joined
Mar 5, 2023
Messages
8
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
  5. 2007
  6. 2003 or older
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I am trying to scrape data from website on bases of product name. There are different rows in web table for a unique product. Some have single row from which I have to grab data, some have two rows and some contain multiple rows. What I want to do is count the number of rows of that product, and then want to run Loop one by one as much times as rows of the product.
Xpath for that matching rows is

VBA Code:
//td[contains(., 'Product Name') /parent::tr

This xpath gives the all rows on which I have to work further. How can I count number of these rows and store to use in a loop.? I am using Chrome browser for automation.

Any suggestion and help is much needed and warmly appreciated. Thanks in advance.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,877
Messages
6,175,138
Members
452,614
Latest member
MRSWIN2709

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top