start_urls = ['https://www.qichacha.com/search?key=北京证大向上']
def parse(self, response):
# the start_url is a list page, the company_url is a detail_url from the list page
yield scrapy.Request(url=company_url, meta={"infos":info},callback=self.parse_basic_info, dont_filter=True)
когда запрос company_url, то ответ 405,
но если я использую
response = requests.get(company_url, headers=headers)
print(response.code)
print(response.txt)
затем ответ 200 и может проанализировать HTML-страницу, или
start_urls=[company_url]
def parse(self, response):
print(response.code)
print(response.txt)
а также ответ 200, я не знаю, почему ответ 405
когда это ответ 405, я печатаю запрос так:
{'_encoding': 'utf-8', 'method': 'GET', '_url': 'https://www.qichacha.com/firm_b18bf42ee07d7961e91a0edaf1649287.html',' _body ': b' ',' priority ': 0,' callback ': None, 'errback': Нет, 'cookies': {}, 'headers': {b'User-Agent ': [b'Mozilla / 5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit / 535.20 (KHTML, как Gecko) Chrome /19.0.1036.7 Safari / 535.20 ']},' dont_filter ': False,' _meta ': {' deep ': 1},' flags ': []}
что с ним не так?