E-mail crawler for yellowpages 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&amp;geo_location_terms=Los%20Angeles%2C%20CA&amp;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:",""))
Knowing that you had a ton of scrappers questions, this doesn't look nice at all. It looks like you were in a hurry and didn't much care about how the code looks.

Styling

Use 4 spaces per indentation level
Constants should be LOWERCASED
You should have a space after ,
Your lines are way too long. Stick to 72 characters or 120 (at most)


Code
First, you don't have to hardcode your search items. Instead, you might as well define a function which returns the data you need (the entire URL):
def build_url(item, location, page):
    params = urllib.parse.urlencode({
        'search_terms': item,
        'geo_location_terms': location,
        'page': page
    })

    return '{}/search?{}'.format(URL, params)

With that in mind, your code might be restructured nicer, like this:
import requests
import urllib

from lxml import html

URL = &quot;https://www.yellowpages.com&quot;
LOWER_LIMIT = 1
UPPER_LIMIT = 10


def build_url(item, location, page):
    params = urllib.parse.urlencode({
        'search_terms': item,
        'geo_location_terms': location,
        'page': page
    })

    return '{}/search?{}'.format(URL, params)


def scrape():
    for page in range(LOWER_LIMIT, UPPER_LIMIT):
        url = build_url('pizza', 'Los Angeles CA', page)
        html_ = requests.get(url).text
        for item in html.fromstring(html_).cssselect('div.info h2.n a:not([itemprop=&quot;name&quot;]).business-name'):
            for data in html.fromstring(requests.get(URL + item.attrib['href']).text).cssselect('a.email-business'):
                print(data.attrib['href'].replace(&quot;mailto:&quot;, &quot;&quot;))


if __name__ == '__main__':
    scrape()

Other changes that I did above:

Move the logic into separate functions
Make the range arguments constants so that they can be easily modified
Add the guard check if __name__ == '__main__'


As is, your scrapper is pretty slow because it has to search in each page the entire html for that specific a info. You might consider using Scrapy.