I've written a script in python to scrape e-mail addresses from different pizza shops located in los-angeles available in yellowpage traversing multiple pages. It is able to go one-layer deep and dig out email addresses. I believe, this crawler has got the ability to parse all the emails from any link no matter how many pages it has spread across. Just needed to adjust the last page number in the crawler.
Here is what I've written:
import requests
from lxml import html
link = "https://www.yellowpages.com"
for page_num in range(1,10):
for item in html.fromstring(requests.get("https://www.yellowpages.com/search?search_terms=pizza&geo_location_terms=Los%20Angeles%2C%20CA&page={0}".format(page_num)).text).cssselect('div.info h2.n a:not([itemprop="name"]).business-name'):
for data in html.fromstring(requests.get(link + item.attrib['href']).text).cssselect('a.email-business'):
print(data.attrib['href'].replace("mailto:",""))