1碘饼,Request方面callback=self.parse莱预。注意不是self.parse()也不是callback = 'parse'
2,xpath里面文本提取要用text()
3徒仓,item生成對(duì)象的時(shí)候要在for循環(huán)之內(nèi)
4璃岳,換ip涡尘,換cookie,換ua都是一樣的歼争,先調(diào)用中繼器拜马,在中繼器構(gòu)造相應(yīng)的方法。
注意
headers(dict) – the headers of this request. The dict values can be strings (for single valued headers) or lists (for multi-valued headers). IfNoneis passed as value, the HTTP header will not be sent at all.
cookies(dict or list) –
the request cookies. These can be sent in two forms.
Using a dict:
request_with_cookies=Request(url="http://www.example.com",cookies={'currency':'USD','country':'UY'})
Using a list of dicts:
request_with_cookies=Request(url="http://www.example.com",cookies=[{'name':'currency','value':'USD','domain':'example.com','path':'/currency'}])
翻譯成人話就是沐绒,cookie和header是request的一個(gè)詞典類型的參數(shù)俩莽,ua是header里面的一個(gè)建。
至于代理乔遮,可以用mate存儲(chǔ)扮超。
meta(dict) – the initial values for theRequest.metaattribute. If given, the dict passed in this parameter will be shallow copied.