Your Name vor 4 Jahren
Ursprung
Commit
48bf6e12c5

BIN
crawl/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
crawl/__pycache__/settings.cpython-38.pyc Datei anzeigen


BIN
crawl/comm/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
crawl/comm/__pycache__/basketball.cpython-38.pyc Datei anzeigen


BIN
crawl/comm/__pycache__/football.cpython-38.pyc Datei anzeigen


BIN
crawl/comm/__pycache__/lottery.cpython-38.pyc Datei anzeigen


BIN
crawl/comm/__pycache__/mydb.cpython-38.pyc Datei anzeigen


+ 1
- 1
crawl/run.py Datei anzeigen

@@ -7,4 +7,4 @@ print(dirpath)
7 7
 # 添加环境变量
8 8
 sys.path.append(dirpath)
9 9
 # 启动爬虫,第三个参数为爬虫name
10
-execute(['scrapy','crawl','basketball-result'])
10
+execute(['scrapy','crawl','football'])

BIN
crawl/spiders/__pycache__/__init__.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/basketball.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/basketball_match.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/basketball_price.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/basketball_result.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/football.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/football_match.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/football_price.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/football_result.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/lottery.cpython-38.pyc Datei anzeigen


BIN
crawl/spiders/__pycache__/util.cpython-38.pyc Datei anzeigen


+ 1
- 0
crawl/spiders/football.py Datei anzeigen

@@ -2,6 +2,7 @@ import scrapy
2 2
 import re
3 3
 import logging
4 4
 from crawl.comm.football import FTMatch, FTPrice, FTResult, WDLOdds, WDLSpreadOdds, ScoreResult, PointsResult, DoubleResult
5
+from crawl.spiders.util import getNoneStr
5 6
 
6 7
 class FootballSpider(scrapy.Spider):
7 8
   name = 'football'

+ 25
- 6
crawl/spiders/football_result.py Datei anzeigen

@@ -102,16 +102,35 @@ class FootballSpider(scrapy.Spider):
102 102
     playRes = []
103 103
 
104 104
     # 胜平负
105
-    playRes.append(res['had']['prs_name'])
105
+    try:
106
+      playRes.append(res['had']['prs_name'])
107
+    except:
108
+      playRes.append('')
109
+    
106 110
     # 让球胜平负
107
-    playRes.append(res['hhad']['prs_name'])
111
+    try:
112
+      playRes.append(res['hhad']['prs_name'])
113
+    except:
114
+      playRes.append('')
115
+    
108 116
     # 比分
109
-    playRes.append(res['crs']['prs_name'])
117
+    try:
118
+      playRes.append(res['crs']['prs_name'])
119
+    except:
120
+      playRes.append('')
121
+    
110 122
     # 总进球
111
-    playRes.append(res['ttg']['prs_name'])
123
+    try:
124
+      playRes.append(res['ttg']['prs_name'])
125
+    except:
126
+      playRes.append('')
127
+    
112 128
     # 半全场
113
-    playRes.append(res['hafu']['prs_name'])
114
-
129
+    try:
130
+      playRes.append(res['hafu']['prs_name'])
131
+    except:
132
+      playRes.append('')
133
+    
115 134
     matchId = re.sub(r'^.*get_pool_rs\?mid=', '', response.url)
116 135
     ftResult = self._matchesMap[matchId]
117 136
     ftResult.playRes = '|'.join(playRes)