Unable to extract website link from a button

Describe the problem.

I am trying to extract the website address from a button - the selector is called "website".
The element shows selected and when scraped, some of the buttons result in a website link being scraped, but most of them result in NULL.
I really can't work out what's going on, as all of the buttons on the page, have a website link on this button.
Please help - thank you.

Url: http://yell.com

Sitemap:
{"_id":"yell-local-businesses","startUrl":["https://www.yell.com/ucs/UcsSearchAction.do?scrambleSeed=131048911&filter=2&keywords=local%20business&location=swindon%2C%20wiltshire&pageNum=1"],"selectors":[{"delay":2000,"id":"scroll-item","multiple":true,"parentSelectors":["_root"],"selector":"div.businessCapsule--mainRow","type":"SelectorElementScroll"},{"delay":0,"id":"title","multiple":false,"parentSelectors":["scroll-item"],"regex":"","selector":"h2","type":"SelectorText"},{"delay":0,"id":"address","multiple":false,"parentSelectors":["scroll-item"],"regex":"","selector":"a.col-sm-24","type":"SelectorText"},{"delay":0,"id":"services","multiple":false,"parentSelectors":["scroll-item"],"regex":"","selector":"div:nth-of-type(6)","type":"SelectorText"},{"delay":0,"id":"more_link","multiple":false,"parentSelectors":["scroll-item"],"selector":"a.businessCapsule--title","type":"SelectorLink"},{"delay":0,"id":"tel_no","multiple":false,"parentSelectors":["more_link"],"regex":"","selector":"div.business--telephone:nth-of-type(1) span[itemprop='telephone']","type":"SelectorText"},{"delay":0,"id":"tel_mobile","multiple":false,"parentSelectors":["more_link"],"regex":"","selector":".business--telephone-noMarginRight span[itemprop='telephone']","type":"SelectorText"},{"delay":0,"id":"category","multiple":false,"parentSelectors":["scroll-item"],"regex":"","selector":"div.businessCapsule--classStrap","type":"SelectorText"},{"delay":0,"extractAttribute":"href","id":"website","multiple":false,"parentSelectors":["scroll-item"],"selector":"a[data-tracking='WL:CLOSED']","type":"SelectorElementAttribute"}]}

@spooner Hi, you should simply update the 'Element attribute' selector to - a:contains(" Website") and keep the same attribute name.

1 Like

@spooner That's because some of the targeted elements have different 'data-tracking' values.

1 Like

Thankyou so much. This worked fantastic!

Thankyou. I did actually see this but didn't know how to get around it lol

@spooner Not a problem. There's a possibility to make manual selector adjustments. You can learn more about that here: Top 5 CSS Selectors You Need to Know.

1 Like

Thanks again. I'm struggling with knowing the syntax of the selection string if I'm honest. I can use the selectors to simply point and click and select, but when it comes to manually editing them to get exactly what I might need, I'm finding it hard to translate what I read in the inspected element and what i need to use to select it. Make sense?
Thanks for responding though.