Skip to content

Instantly share code, notes, and snippets.

@xiaojay
Created January 25, 2013 11:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xiaojay/4633741 to your computer and use it in GitHub Desktop.
Save xiaojay/4633741 to your computer and use it in GitHub Desktop.
#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)
@Gentlesoulmate
Copy link

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment