提交 329c83aa 作者: LiuLiYuan

国资委 9/11

上级 8fb1c602
...@@ -257,20 +257,20 @@ def get_content1(): ...@@ -257,20 +257,20 @@ def get_content1():
except Exception as e: except Exception as e:
log.info(f'---{href}--------{e}-------') log.info(f'---{href}--------{e}-------')
continue continue
if '.pdf' in file_href or '.docx' in file_href or '.doc' in file_href or 'xls' in file_href or '.zip' in file_href \ if '.pdf' in file_href or '.docx' in file_href or '.doc' in file_href or 'xls' in file_href or '.zip' in file_href \
or '.rar' in file_href or '.ppt' in file_href or '.PDF' in file_href or '.DOC' in file_href \ or '.rar' in file_href or '.ppt' in file_href or '.PDF' in file_href or '.DOC' in file_href \
or '.XLS' in file_href or '.ZIP' in file_href or '.RAR' in file_href: or '.XLS' in file_href or '.ZIP' in file_href or '.RAR' in file_href:
file_name = file.text.strip() file_name = file.text.strip()
retData = baseCore.uploadToserver(file_href,'1766') retData = baseCore.uploadToserver(file_href,'1766')
if retData['state']: if retData['state']:
pass pass
else: else:
continue continue
att_id,full_path = baseCore.tableUpdate(retData,'国务院文件',file_name,num) att_id,full_path = baseCore.tableUpdate(retData,'国务院文件',file_name,num)
id_list.append(att_id) id_list.append(att_id)
#todo:将返回的地址更新到soup #todo:将返回的地址更新到soup
file['href'] = 'http://114.115.215.96/' + full_path file['href'] = 'http://114.115.215.96/' + full_path
except: except:
log.error(f'{title}...{href}...获取内容失败') log.error(f'{title}...{href}...获取内容失败')
continue continue
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论