problem description
scrapy gives parse, different methods for the same url. Some can execute, and some cannot
.the environmental background of the problems and what methods you have tried
related codes
urls=["http://maoyan.com/xseats/201809300156836?movieId=342166&cinemaId=16887","http://maoyan.com/xseats/201809300237849?movieId=1210830&cinemaId=2285","http://maoyan.com/xseats/201809300013842?movieId=1217402&cinemaId=13199"]
for url in urls:
yield Request(url=url,callback=self.parse)
this parse can execute
-sharp -sharp id
myclient = pymongo.MongoClient("mongodb://localhost:27017/")
mydb = myclient["scrapy"]
mycol_movie = mydb["movieTime"]
movies=list(mycol_movie.find().sort([("movieTime",1)]))
for movie in movies:
now = float(datetime.datetime.now().strftime("%H.%M"))
if (now > movie["movieTime"]):
print(str(movie["movieTime"]) + " ")
else:
while True:
if (movie["movieTime"] < now + 0.07):
now = float(datetime.datetime.now().strftime("%H.%M"))
print(str(now)+" "+str(movie["movieTime"]))
url="http://maoyan.com" + str(movie["movieUrl"])
print(url)
try:
yield Request(url=url, callback=self.parse)
except:
print("")
finally:
print("")
print(" ")
break
else:
print("45")
time.sleep(60)
now = float(datetime.datetime.now().strftime("%H.%M"))
this cannot be executed,
what result do you expect? What is the error message actually seen?
allows complex ones to be executed.