Parse is runnable now.
This commit is contained in:
parent
e10ac12d04
commit
f9799c30d8
@ -8,20 +8,18 @@ class WikipediaParser(Parser):
|
|||||||
website = "http://en.wikipedia.org/wiki/*"
|
website = "http://en.wikipedia.org/wiki/*"
|
||||||
__spider = None
|
__spider = None
|
||||||
|
|
||||||
print "test1"
|
|
||||||
#def __init__(self, csid):
|
#def __init__(self, csid):
|
||||||
# self.website = "http://en.wikipedia.org/wiki/{id}".format(id=csid)
|
# self.website = "http://en.wikipedia.org/wiki/{id}".format(id=csid)
|
||||||
|
|
||||||
def parse(self, response):
|
def parse(self, response):
|
||||||
print "test1"
|
print response.url
|
||||||
#self.log('A response from %s just arrived!' % response.url)
|
#self.log('A response from %s just arrived!' % response.url)
|
||||||
#def parse():
|
sel = Selector(response)
|
||||||
sel = Selector("http://en.wikipedia.org/wiki/Methane")
|
|
||||||
items = []
|
items = []
|
||||||
item = Result()
|
item = Result()
|
||||||
item['attribute']="Melting point"
|
item['attribute']="Melting point"
|
||||||
item['value']=site.xpath('//tr[contains(@href, "/wiki/Melting_point")]/text()').extract()
|
item['value']="value1" # sel.xpath('//tr[contains(@href, "/wiki/Melting_point")]/text()').extract()
|
||||||
item['source']= self.website
|
item['source']= "Wikipedia"
|
||||||
items.append(item)
|
items.append(item)
|
||||||
print item['attribute']
|
print item['attribute']
|
||||||
print item['value']
|
print item['value']
|
||||||
|
Reference in New Issue
Block a user