Commit 3ec3ca57 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Fix shadow variable

parent 16590662
......@@ -23,7 +23,7 @@ class AitopSpider(BaseSpider):
url = 'https://aitopics.org'
def tags(res):
concept_tags = response.xpath(".//div[contains(@class, 'facet_concept-tagsraw')]//div//div//ul//li")
concept_tags = res.xpath(".//div[contains(@class, 'facet_concept-tagsraw')]//div//div//ul//li")
for i in concept_tags:
if i.xpath(".//@title").extract_first().lower() == name.lower():
href = i.xpath(".//a/@href").extract_first()
......
......@@ -10,7 +10,7 @@ class BaseSpider(scrapy.Spider):
def __init__(self, query=None, *args, **kwargs):
super(BaseSpider, self).__init__(*args, **kwargs)
self.condition = query
self.query = "SELECT id, name, country FROM wp_esi_entity WHERE 1 and id=17"
self.query = "SELECT id, name, country FROM wp_esi_entity WHERE 1 and id=3"
if self.condition:
print(self.condition)
self.query += ' or {}'.format(self.condition)
......
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