Untitled conversation
- User
{ "": { "noticeTime": "2024-06-06 16:12:33", "fieldValues": null, "staticState": null, "id": "86f76443-23dc-11ef-80d3-fa163ef065a1", "state": "1", "stateStr": null, "issign": "0", "isdel": "0", "isdelStr": null, "iscomment": "0", "iscommentStr": null, "isscore": null, "isscoreStr": null, "video": null, "channelids": null, "checkOpenendtime": null, "mobileChannelids": null, "mwebChannelids": null, "addUserLoginName": null, "addUserName": null, "countnum": 0, "infoordernum": 0, "datename": null, "htmlIndexnum": 1170149, "htmlIndexnumLike": null, "htmlFileName": null, "isimgs": null, "stateResult": null, "htmlpath": "/site/sichuan/ggxx/info/2024/8a69cdd38fe88059018fe8d012f8123d.html", "mobilepath": null, "sql": null, "formid": null, "siteBean": null, "noticeId": "8a69cdd38fe88059018fe8d012f8123d", "regionName": "汶川县", "purchaseNature": "3", "catalogueNameList": "工程设计服务", "planCodes": "51322124210200001747[2024]00080", "purchaseManner": "6", "purchaser": "汶川县教育局", "budget": "346000.0000", "regionCode": "513221", "noticeType": "001026", "purchaserAddr": null, "purchaserLinkPhone": null, "noticeTypeName": null, "openTenderTime": "2024-06-05 10:00:00", "expireTime": null, "videoType": null, "successfulMoney": null, "agency": "四川都林工程咨询有限公司", "agencyCode": null, "openTenderCode": "N5132212024000069", "purchaserLinkMan": null, "agentManageName": "", "agentLinkPhone": null, "agentLinkMan": null, "agentAddress": null, "recordTime": null, "demandTime": null, "govService": null, "punishType": null, "respondents": null, "transactionType": null, "complainant": null, "punishObject": null, "contactPerson": null, "transactionTypeCode": null, "contactNumber": null, "noticeDetailUrl": null, "bidCompany": null, "openTenderPlace": null, "singleNoticeGuid": null, "intentionNoticeGuid": null, "planId": "8a69d5578f755e78018f941728822b80", "site": "94c965cc-c55d-4f92-8469-d5875c68bd04", "infosite": null, "sitename": null, "indexnum": null, "opentype": "0", "opentimetype": "1", "openendtime": null, "openendtimeSec": null, "openendtimeStr": null, "channel": "c5bff13f-21ca-4dac-b158-cb40accd3035", "channelname": null, "channelPagemark": "cggg", "channelIndexnum": 878, "channelFolder": null, "channelParid": null, "channelParPagemark": null, "title": "汶川县教育局阿坝州汶川县水磨中学校(寄宿制)教学综合楼建设项目中标(成交)结果公告", "shorttitle": "汶川县教育局阿坝州汶川县水磨中学校(寄宿制)教学综合楼建设项目中标(成交)结果公告", "showtitle": null, "titleSuffix": null, "showtitleLen": 0, "pageurl": "/freecms/site/sichuan/ggxx/info/2024/8a69cdd38fe88059018fe8d012f8123d.html", "noids": null, "sitepath": null, "contextPath": "/freecms", "channels": null, "starttime": null, "endtime": null, "searchKey": null, "ishot": null, "isnew": null, "titlecolor": null, "titleblod": null, "source": null, "author": null, "description": "#noticeArea { line-height:32px; font-size: 16px;text-align: justify;font-family: '宋体';word-break: break-all;}\r #noticeArea h1, #noticeArea h2, #noticeArea h3, #noticeArea h4, #noticeArea h5, #noticeArea h6{ line-height:2; }\r #noticeArea *{padding:0; margin:0;}\r #noticeArea .focuscontent{ color:#337ab7;}\r #noticeArea strong{ font-weight: bold;}\r #noticeArea h2{font-size: 24px; text-align: center; margin-bottom: 20px;text-align: left;}\r #noticeArea h3", "tags": null, "img": null, "url": null, "attchs": null, "addtimeStr": "2024-06-06 08:12:34", "addtimees": "2024-06-06 08:12:34", "dateFormat": null, "templet": null, "mwebtemplet": null, "istop": null, "topendtime": null, "topendtimeStr": null, "clicknum": null, "adduser": null, "adduserLike": null, "content": "", "addtime": 1717661554000 }, "code": "200", "data": [ { "noticeTime": "2024-06-06 17:26:35", "fieldValues": null, "staticState": null, "id": "def71974-23e6-11ef-80d3-fa163ef065a1", "state": "1", "stateStr": null, "issign": "0", "isdel": "0", "isdelStr": null, "iscomment": "0", "iscommentStr": null, "isscore": null, "isscoreStr": null, "video": null, "channelids": null, "checkOpenendtime": null, "mobileChannelids": null, "mwebChannelids": null, "addUserLoginName": null, "addUserName": null, "countnum": 0, "infoordernum": 0, "datename": null, "htmlIndexnum": 1170509, "htmlIndexnumLike": null, "htmlFileName": null, "isimgs": null, "stateResult": null, "htmlpath": "/site/sichuan/ggxx/info/2024/8a69c19e8fe9148f018fec9c439e6538.html", "mobilepath": null, "sql": null, "formid": null, "siteBean": null, "noticeId": "8a69c19e8fe9148f018fec9c439e6538", "regionName": "市中区", "purchaseNature": "1", "catalogueNameList": "其他资料", "planCodes": "51100224210200001466[2024]00058", "purchaseManner": "3", "purchaser": "内江市市中区学校后勤工作指导中心", "budget": "1045300.0000", "regionCode": "511002", "noticeType": "001023", "purchaserAddr": null, "purchaserLinkPhone": null, "noticeTypeName": null, "openTenderTime": "2024-06-06 09:30:00", "expireTime": null, "videoType": null, "successfulMoney": null, "agency": "四川子禾招标代理有限公司", "agencyCode": null, "openTenderCode": "N5110022024000022", "purchaserLinkMan": null, "agentManageName": "", "agentLinkPhone": null, "agentLinkMan": null, "agentAddress": null, "recordTime": null, "demandTime": null, "govService": null, "punishType": null, "respondents": null, "transactionType": null, "complainant": null, "punishObject": null, "contactPerson": null, "transactionTypeCode": null, "contactNumber": null, "noticeDetailUrl": null, "bidCompany": null, "openTenderPlace": null, "singleNoticeGuid": null, "intentionNoticeGuid": null, "planId": "8a69d5578f755e78018f9f994c9706b7", "site": "94c965cc-c55d-4f92-8469-d5875c68bd04", "infosite": null, "sitename": null, "indexnum": null, "opentype": "0", "opentimetype": "1", "openendtime": null, "openendtimeSec": null, "openendtimeStr": null, "channel": "c5bff13f-21ca-4dac-b158-cb40accd3035", "channelname": null, "channelPagemark": "cggg", "channelIndexnum": 878, "channelFolder": null, "channelParid": null, "channelParPagemark": null, "title": "内江市市中区学校后勤工作指导中心2024年秋季-2025年春季义务教育阶段学生作业本成交结果公告", "shorttitle": "内江市市中区学校后勤工作指导中心2024年秋季-2025年春季义务教育阶段学生作业本成交结果公告", "showtitle": null, "titleSuffix": null, "showtitleLen": 0, "pageurl": "/freecms/site/sichuan/ggxx/info/2024/8a69c19e8fe9148f018fec9c439e6538.html", "noids": null, "sitepath": null, "contextPath": "/freecms", "channels": null, "starttime": null, "endtime": null, "searchKey": null, "ishot": null, "isnew": null, "titlecolor": null, "titleblod": null, "source": null, "author": null, "description": "#noticeArea { line-height:32px; font-size: 16px;text-align: justify;font-family: '宋体';word-break: break-all;}\r #noticeArea h1, #noticeArea h2, #noticeArea h3, #noticeArea h4, #noticeArea h5, #noticeArea h6{ line-height:2; }\r #noticeArea *{padding:0; margin:0;}\r #noticeArea .focuscontent{ color:#337ab7;}\r #noticeArea strong{ font-weight: bold;}\r #noticeArea h2{font-size: 24px; text-align: center; margin-bottom: 20px;text-align: left;}\r #noticeArea h3", "tags": null, "img": null, "url": null, "attchs": null, "addtimeStr": "2024-06-06 09:26:36", "addtimees": "2024-06-06 09:26:36", "dateFormat": null, "templet": null, "mwebtemplet": null, "istop": null, "topendtime": null, "topendtimeStr": null, "clicknum": null, "adduser": null, "adduserLike": null, "content": "", "addtime": 1717665996000 } ], "msg": "操作成功", "total": 2690 } 上述信息来自于网页response,希望用python解析提取其中的purchaser,noticeTime,htmlpath,budget,openTenderTime,agency,openTenderCode,shorttitle,并分析content的内容,提取content里面的供应商名称,中标(成交)金额,输出为excel
- Assistant
- User
- Assistant
import re content = "上述content的数据" # 提取供应商名称和中标金额的正则表达式模式 pattern = r"<td style=\"width:200px;word-break:break-all;\">(.*?)<\/td>.*?<span>(.*?)<\/span>" # 匹配供应商名称和中标金额 matches = re.findall(pattern, content, re.DOTALL) suppliers = [] amounts = [] for match in matches: supplier = match[0].strip() amount = match[1].strip() suppliers.append(supplier) amounts.append(amount) print("供应商名称:", suppliers) print("中标(成交)金额:", amounts)以上代码使用正则表达式从content中提取供应商名称和中标金额,并将结果存储在suppliers和amounts列表中。请将实际的content数据替换到代码中进行测试。