Advertisement
Guest User

Untitled

a guest
Sep 15th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import scrapy
  3.  
  4.  
  5. class AutocodesSpider(scrapy.Spider):
  6.     name = "autocodes"
  7.     allowed_domains = ["autocodes.com"]
  8.     start_urls = (
  9.         'http://www.autocodes.com/',
  10.     )
  11.  
  12.     def parse(self, response):
  13.         for link in response.selector.xpath('//table[1]//a/@href').extract():
  14.             yield scrapy.Request(link, self.test)
  15.  
  16.         # print(response.selector.xpath('//table[1]//a'))
  17.     def test(self, response):
  18.         print('here')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement