补充无锡医院判断

This commit is contained in:
2024-09-09 10:03:33 +08:00
parent cd1b5d54a3
commit f41fcc89d7
3 changed files with 16 additions and 7 deletions

View File

@@ -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: