Compare commits
No commits in common. 'dev_test3' and 'master' have entirely different histories.
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/../../../../../:\PyCharm\文件\疫情数据分析\.idea/dataSources/
|
||||
/dataSources.local.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (base)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/疫情数据分析.iml" filepath="$PROJECT_DIR$/.idea/疫情数据分析.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.7 (base)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
{
|
||||
"CurrentProjectSetting": "无配置"
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0
|
||||
Debug|Win32|C:\Visual Studio\Dijkstra算法\|
|
||||
Debug|Win32|C:\Users\13251\source\repos\AVL树\|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,11 @@
|
||||
Stack trace:
|
||||
Frame Function Args
|
||||
00800000010 0018006392E (00180279F10, 0018026AFD1, 00800000010, 000FFFFBA00)
|
||||
00800000010 0018004973A (00100002000, 000FFFFCBA0, 00180350090, 00000000002)
|
||||
00800000010 00180049772 (00000000002, 001803503A0, 00800000010, 00000000008)
|
||||
00800000010 0018005CBDD (000FFFFCC94, 000FFFFCBD0, 000FFFFCC68, 000FFFFCC94)
|
||||
000FFFFCBAC 0018005CD4F (675C645C625C2F5C, 655C2E5C745C695C, 6F5C635C755C645C, 2E5C725C655C645C)
|
||||
000FFFFCCE0 00180049EE8 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
000FFFFFFF0 00180048846 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
000FFFFFFF0 001800488F4 (00000000000, 00000000000, 00000000000, 00000000000)
|
||||
End of stack trace
|
@ -0,0 +1,25 @@
|
||||
class summaryDataOut:
|
||||
confirmed=0
|
||||
died=0
|
||||
curConfirm=0
|
||||
cured=0
|
||||
confirmedRelative=0
|
||||
curedRelative=0
|
||||
diedRelative=0
|
||||
curConfirmRelative=0
|
||||
relativeTime=0
|
||||
time=''
|
||||
|
||||
def blankNum (self,object):
|
||||
return ' '*(12-len(str(object)))
|
||||
|
||||
def PrintOut(self):
|
||||
print("截至%s国外疫情概况:"%self.time)
|
||||
print("现有确诊:%d" % self.curConfirm, end=self.blankNum(self.curConfirm))
|
||||
print("相对昨日新增:%d"%self.curConfirmRelative)
|
||||
print("累计确诊:%d"%self.confirmed,end=self.blankNum(self.confirmed))
|
||||
print("相对昨日新增:%d"%self.confirmedRelative)
|
||||
print("累计治愈:%d"%self.cured,end=self.blankNum(self.cured))
|
||||
print("相对昨日新增:%d"%self.curedRelative)
|
||||
print("累计死亡:%d"%self.died,end=self.blankNum(self.died))
|
||||
print("相对昨日新增:%d"%self.diedRelative)
|
@ -0,0 +1,34 @@
|
||||
import requests
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
import json
|
||||
|
||||
from 国外总数据 import summaryDataOut
|
||||
|
||||
# 获取数据
|
||||
req = requests.get ('https://voice.baidu.com/act/newpneumonia/newpneumonia/?from=osari_pc_3#tab4')
|
||||
content = req.content.decode('utf-8')
|
||||
soup = BeautifulSoup(content,'html.parser')
|
||||
|
||||
# 过滤筛选
|
||||
tag = soup.find('script',attrs={'type':'application/json','id':'captain-config'})
|
||||
tagstr=tag.string #标签转化为字符串
|
||||
tagdic=json.loads(tagstr) #标签字符串转化为字典
|
||||
component=tagdic['component'][0]
|
||||
time= component['mapLastUpdatedTime']
|
||||
result = component['summaryDataOut'] #字典中找出'component'key下的'summaryDataOut'key内容
|
||||
|
||||
# 存储
|
||||
OutData=summaryDataOut()
|
||||
|
||||
OutData.confirmed=int(result['confirmed'])
|
||||
OutData.confirmedRelative=int(result['confirmedRelative'])
|
||||
OutData.cured=int(result['cured'])
|
||||
OutData.curedRelative=int(result['curedRelative'])
|
||||
OutData.died=int(result['died'])
|
||||
OutData.diedRelative=int(result['diedRelative'])
|
||||
OutData.curConfirm=int(result['curConfirm'])
|
||||
OutData.curConfirmRelative=int(result['curConfirmRelative'])
|
||||
OutData.time=time
|
||||
|
||||
OutData.PrintOut()
|
Loading…
Reference in new issue