2010-10-24 20 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) 
相關問題