私はタイトルをThis.から抽出しようとしていますが、resposnse urlのタイトルではない別のタイトルを取得しています。 私はthis-リクエストURLから間違った値を取得しています
class ElementSpider(scrapy.Spider):
name = 'qwerty4'
allowed_domains = ["burbank.com.au"]
start_urls = ["https://www.burbank.com.au/victoria/home-details/alphington-153-179727", "https://www.burbank.com.au/victoria/home-details/sandringham-151-171569", "https://www.burbank.com.au/victoria/home-details/sandringham-151-181680", "https://www.burbank.com.au/victoria/home-details/bellfield-184-171585", "https://www.burbank.com.au/victoria/home-details/carlton-178-172662", "https://www.burbank.com.au/victoria/home-details/carlton-178-178079" ]
def parse(self, response):
title = response.xpath('//div[@class="col-md-4 col-xs-12 col-sm-12"]/div[@class="housename"]/span/text()').extract()[0]
print response.url
print title
をしようと、いくつかの要求のための間違ったデータを取得しています。出力は -
問題を解決する方法を提案してください。
ありがとうございます。 CONCURRENT_REQUESTSは何をするのですか?私はそれを50に設定すればどうなるの? –
治療は並行して要求を処理します。これは、一度に指定された数の要求を送信することを意味します。 "1"に変更すると、最初の要求からの応答を受信した後、1つの要求のみを送信し、次の要求を送信します。 「50」に設定すると、scrapyは一度に50個の要求を送信します。 – bbanzzakji