Created
January 25, 2013 11:35
-
-
Save xiaojay/4633741 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
#coding=utf-8 | |
import re | |
from scrapy import log | |
from scrapy.http import Request, FormRequest | |
from scrapy.spider import BaseSpider | |
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from scrapy.selector import HtmlXPathSelector | |
def print_red(s):print '\033[0;31;48m%s\033[0m'%s | |
class SimSpider(BaseSpider): | |
name = 'sim_spider' | |
def start_requests(self): | |
login_url = 'http://www.renren.com/plogin.do' | |
return [FormRequest(login_url, | |
formdata = {'email': '', 'password': ''}, | |
callback=self.logined_in)] | |
def logined_in(self, response): | |
url = 'http://page.renren.com/601621937/fdoing/4510113664?curpage=1' | |
return self.make_requests_from_url(url) | |
def parse(self, response): | |
from scrapy.shell import inspect_response | |
inspect_response(response) |
Hi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi everyone.https://za.gl/R9jVN