To extract url from a webpage or any string is quite easy with Agenty’s chrome extension. For extraction of hyperlinks, you just need to define the selector and then the attribute to extract the value you want.
For example, when setting-up your scraping agent in Agenty’s chrome extension, you can click on the link element to generate a selector automatically (or manually type the CSS selector) for the link element. Then select the
ATTR extract option from drop down with
href attribute(as in screenshot below).
The attribute option is case sensitive. So if the target website has the small character then you need to use the small cases like “href” and capital case when in capital "HREF "
ATTR(Attribute) option is not just limited to hyperlinks, but you can use the attribute option to extract anything from an HTML tag. For examples :
- Alt of an image : alt
- Image source path using the attribute as “src”
- HTML 5 data-tag : data-id, data-name etc using the name of data attribute as “data-xx”
- Title, href, meta description content, hidden tag value, class, id and more…
Just find the selector and then write the attribute in
ATTR to extract the item you want.