Commit 3c19d6e7 authored by 李小芳's avatar 李小芳

add

parent 3310832b
......@@ -99,22 +99,28 @@ class CrawlerMain(object):
except ReadTimeout:
print('timeout')
pass
return None, None
except HTTPError:
print('httperror')
pass
return None, None
# 请求异常
except RequestException:
print('reqerror')
pass
return None, None
except socket.timeout:
print(socket.timeout)
pass
return None, None
except ReadTimeoutError:
print("ReadTimeoutError")
pass
return None, None
except ConnectionError:
print("ConnectionError")
pass
return None, None
def get_search_service_info_list(self, page=1, city_id=-1, query=""):
url = "https://www.soyoung.com/searchNew/product?" \
......@@ -128,22 +134,28 @@ class CrawlerMain(object):
except ReadTimeout:
print('超时,执行下一个请求')
pass
return None
except HTTPError:
print('httperror')
pass
return None
# 请求异常
except RequestException:
print('reqerror')
pass
return None
except socket.timeout:
print(socket.timeout)
pass
return None
except ReadTimeoutError:
print("ReadTimeoutError")
pass
return None
except ConnectionError:
print("ConnectionError")
pass
return None
def get_services_list(self, res_json, query="", city_name=""):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment