Commit 0793811f authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

fix bug in making request

parent ed9259da
......@@ -28,8 +28,10 @@ class MobiHealthNewsSpider(scrapy.Spider):
companies = CompanyMaker(self.comp)
companies.make_companies(self.name)
for i in companies.get_companies():
yield scrapy.Request(i.url, callback=self.parse, meta={'company': i,
'post_id': 0})
try:
yield scrapy.Request(i.url + '/', callback=self.parse, meta={'company': i, 'post_id': 0})
except:
pass
def parse(self, response):
try:
......
......@@ -28,7 +28,10 @@ class TechcrunchSpider(scrapy.Spider):
companies = CompanyMaker(self.comp)
companies.make_companies(self.name)
for i in companies.get_companies():
yield scrapy.Request(i.url + '/', callback=self.parse, meta={'company': i, 'post_id': 0})
try:
yield scrapy.Request(i.url + '/', callback=self.parse, meta={'company': i, 'post_id': 0})
except:
pass
def parse(self, response):
if 'tag' in response.url:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment