Created
July 21, 2015 00:43
-
-
Save royopa/70ab94bcf16ef96e385d to your computer and use it in GitHub Desktop.
Crawler ZCE Yellow Pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
def get_url(url): | |
# Get the page | |
r = requests.get(url) | |
if r.status_code == 404: | |
print('Not found ', url) | |
return | |
if r.status_code == 200: | |
print('Found ', url) | |
return | |
url = 'http://www.zend.com/en/yellow-pages/ZEND' | |
i = 23069 | |
while i < 999999: | |
zce_id = str(i).zfill(6) | |
r = get_url(url+zce_id) | |
i = i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment