Skip to content

Instantly share code, notes, and snippets.

@royopa
Created July 21, 2015 00:43
Show Gist options
  • Save royopa/70ab94bcf16ef96e385d to your computer and use it in GitHub Desktop.
Save royopa/70ab94bcf16ef96e385d to your computer and use it in GitHub Desktop.
Crawler ZCE Yellow Pages
# -*- 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