我查看了scrapy docs,但是scrapy可以发送http表单(例如:用户名,密码,......)并解析发送此表单的结果吗?
答案 0 :(得分:1)
def parse_page1(self, response):
item = MyItem()
item['main_url'] = response.url
request = Request("http://www.example.com/some_page.html",
callback=self.parse_page2)
request.meta['item'] = item
return request
def parse_page2(self, response):
item = response.meta['item']
item['other_url'] = response.url
return item
您只需将回调参数函数传递给请求,然后在parse_page2中解析结果;)