Created
September 17, 2016 18:42
-
-
Save anonymous/b41b2b4407b53185e9694882d538b49d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy, os, time | |
class TBTCrawler(scrapy.Spider): | |
name = 'tbt' | |
def start_requests(self): | |
self.t1 = time.time() | |
r = scrapy.Request('http://www.tahribat.com/Forum/') | |
yield(r) | |
def parse(self, response): | |
c = len(response.xpath('//a/@href')) | |
self.t2 = time.time() | |
print self.t2 - self.t1 | |
if __name__ == "__main__": | |
com = 'scrapy runspider "%s"' % __file__ | |
os.system(com) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment