Skip to main content
Solved

how can i use While Loop to capture all (e.g.) a tags?

  • 23 May 2024
  • 2 replies
  • 43 views

I am attempting to capture all the <a> tags on a web page, then logging all the hrefs from those a tags. Not sure how to get started, other than using the Loop action.

2 replies

Userlevel 3
Badge +7

you could use Loop While Recorder:Capture Object exists - then use wildcards in the selection for the capture so it can be iterated through.
 

A better way would be to captue the webpage as a file, then use a string operation to find each instance of the “<a href=” string and extract the url using something like a regular expression.

There are many different ways to perform this operation, you might need to go back and redefine the process.

Userlevel 2
Badge +6

Try this: https://botstore.automationanywhere.com/bot/a2019-html-parser-package

Use Search with selector activity or Simple search for elements by tag

Reply