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
# -*- coding:utf-8 -*- | |
import scrapy | |
from scrapy.exceptions import CloseSpider | |
class LoginSpider(scrapy.Spider): | |
name = 'login-spider' | |
start_urls = ['http://quotes.toscrape.com/login'] | |
def parse(self, response): |
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 | |
# this example needs the scrapyjs package: pip install scrapyjs | |
# it also needs a splash instance running in your env or on Scrapy Cloud (https://github.com/scrapinghub/splash) | |
class SplashSpider(scrapy.Spider): | |
name = 'splash-spider' | |
download_delay = 3 | |
def start_requests(self): |
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
# -*- encoding:utf-8 -*- | |
from __future__ import print_function | |
class BSTNode(object): | |
def __init__(self, key, value=None, left=None, right=None): | |
self.key = key | |
self.value = value | |
self.left = left |