补充无锡医院判断
This commit is contained in:
@@ -44,11 +44,11 @@ def download_pdf(url, local_filename=None):
|
||||
|
||||
|
||||
@retry(stop=stop_after_attempt(3), wait=wait_random(1, 3), reraise=True,
|
||||
after=lambda x: logging.warning('获取无锡锡山人民医院票据失败!'))
|
||||
def get_wxxsh_pdf_url(url):
|
||||
after=lambda x: logging.warning('获取无锡医院票据失败!'))
|
||||
def get_wx_pdf_url(url):
|
||||
response = requests.get(url)
|
||||
if response.status_code != 200:
|
||||
raise Exception(f'请求无锡锡山人民医院票据失败!状态码: {response.status_code}')
|
||||
raise Exception(f'请求无锡医院票据失败!状态码: {response.status_code}')
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
pdf_url = soup.find('a', string='点击查看电子票据')
|
||||
if pdf_url:
|
||||
|
||||
Reference in New Issue
Block a user