2010-10-24 67 views
1

根据httpFox(Firefox插件)的内容构建了以下FormRequest。但是,Web服务器一直返回“500内部服务器错误”。在使用Scrapy发送此FormRequest后,Web服务器返回“500内部服务器错误”

有人可以帮助我吗?

原始URL是: http://www.intel.com/jobs/jobsearch/index_ne.htm?Location=200000008

这里是我的蜘蛛的骨架:

class IntelSpider(BaseSpider): 
    name = "intel.com" 
    allowed_domains = ["taleo.net"] 

    def start_requests(self): 
     req_china = FormRequest("https://intel.taleo.net/careersection/10020/moresearch.ajax", 
           formdata={ 
            'iframemode': '1', 
            'ftlpageid': 'reqListAdvancedPage', 
            'ftlinterfaceid': 'advancedSearchFooterInterface', 
            'ftlcompid': 'SEARCH', 
            ... # commentsThere are a lots of data here.# 
            'location1L2': '-1', 
            'dropListSize': '25', 
            'dropSortBy': '10'}, 
           callback=self.test) 

     return [req_china] 

def test(self, response): 
    print response.body 
    return 
+0

你开始一个竞争对手Taleo公司? – 2011-04-02 04:18:01

回答

2

你的问题是来自英特尔的网页,而不是从scrapy。 但是...... 形式通常有一些隐藏的领域,使POST请求最好的办法是这样的:

def start_requests(self,response): 
     req_china = FormRequest.from_response(response=response, 
           formdata={ 
            'iframemode': '1', 
            'ftlpageid': 'reqListAdvancedPage', 
            'ftlinterfaceid': 'advancedSearchFooterInterface', 
            'ftlcompid': 'SEARCH', 
            ... # commentsThere are a lots of data here.# 
            'location1L2': '-1', 
            'dropListSize': '25', 
            'dropSortBy': '10'}, 
           callback=self.test) 
相关问题