# Get website urls from Yellow Pages

**URL:** <https://forum.seocontentmachine.com/t/get-website-urls-from-yellow-pages/278>\
**Category:** workflow\
**Tags:** dynamic-scraper\
**Created:** [May 20, 2024, 2:09pm UTC](https://forum.seocontentmachine.com/t/get-website-urls-from-yellow-pages/278 "2024-05-20T14:09:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim](https://forum.seocontentmachine.com/user_avatar/forum.seocontentmachine.com/tim/32/486_2.png) [@Tim](https://forum.seocontentmachine.com/u/Tim)\
**Post date:** [May 20, 2024, 2:09pm UTC](https://forum.seocontentmachine.com/t/get-website-urls-from-yellow-pages/278/1 "2024-05-20T14:09:12Z")

</div>

## 1. Load Yellow pages

> [https://www.yellowpages.ca/search/si/1/Plumber/Vic+Campbell+Boulevard+Charlottetown+PE](https://www.yellowpages.ca/search/si/1/Plumber/Vic+Campbell+Boulevard+Charlottetown+PE)

# 2. Select item

Select the website button, click exactly to just get website button class

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/1ebb52a7a0a96455091f9884e6e8686d2d4c60cf.png)

If done correctly it shows 11 items.

# 3. Change selector to outerHtml

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/c29c6fa2a11a1926e21be1a045ebd2eb7c6d8096.png)

Click on data button

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/f4578e0b8fc2e4cefff47a391cc59a608de61310.png)

Preview content

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/5c3a64e26bc9cc7a2090938e9cbad039dab94bfb.png)

The url of the website is hidden inside the anchor tag as a redirect

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/fef6fb5bacb51072c5fd38b72967045bf4a24a5e.png)

Select just the anchor by editing the selector and adding **‘a’** at the end  
Change action to getAttribute href to return url  
 ![image](https://forum.seocontentmachine.com/uploads/default/optimized/1X/3dd85a513deabcbae5fe10ab09b15d8730e07d5f_2_690x48.png)

Now we have urls

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/a59041bf4956d52e6e0143dfd9917afecd80c6b8.png)

## 4. Clean up output

Use regex filtering to get just the http

Click filter button

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/90f48743abb83b18d2f01f11adf260a2f45ec698.png)

Regex replace to remove

> .\*==\>

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/ec670a4ee6736e2efb7541b249c89a5148d879e1.png)

Regex applied

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/7c4a89731003c86b9928644d9093e7d02df49c91.png)

If you need help with regex  
Here is an online test and example tool

> [https://regex101.com/](https://regex101.com/)
> 
> ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/a16eacdb2bfdf295141e77a9009ce3655838b392.png)

Just add =\> at the end as this is special SCM code for regex ends, replace with ‘’ or nothing.

## 5. Adding pages

Add current page to list

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/2c410d8fda1be64fa354ea8b2bc85ac5c689a8de.png)

To next results, click next inside the browsing window

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/59062d84c6a1fa8d461e8a39b1820b1e10fc87d9.png)

Notice new url has 2

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/665f83e76dcc53db58172ac8b2c39ce24154b1ff.png)

Add as many urls as pages required

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/b5f9db3db88c2fec1ffa312aeb395c71847606c8.png)

## 6. Export CSV

Select CSV

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/c8dccdbf349cbda319ca236e613719a42e6759f9.png)

## Sample

 ![image](https://forum.seocontentmachine.com/uploads/default/original/1X/3f32837daa546f697a7b6c458ef4beafcbef480a.png)

## Project template

[Yellow pages.zip](https://forum.seocontentmachine.com/uploads/short-url/7y6jEwJWl4vhtgCO0yPkbrdIbTR.zip) (1.1 KB)
