Oct-16-2018, 08:01 AM
i was trying to do the same thing with different website, but seems doesn't work as i wanted to....
# -*- coding: utf-8 -*- import scrapy class TabotSpider(scrapy.Spider): name = 'TaBot' login_url = 'https://www.tatechnix.de/tatechnix/gx/?language=en' start_urls = ['https://www.tatechnix.de/tatechnix/gx/product_info.php?info=p44235_ta-technix-sport-suspension-kit-opel-astra-h-caravan-2-0t-1-7-1-9cdti--without-level-control-type-a-h-30-30mm.html',] def init_request(self): return scrapy.Request( url=self.login_url, callback=self.login, ) def login(self, response): yield scrapy.FormRequest.from_response( response=response, formid='loginbox', formdata={ 'text': 'example', 'password': 'example', }, callback=self.initialized, ) def parse(self, response): for content in response.css('#gm_attr_calc_price'): yield { 'Price' : content.css('span[itemprop="price"]::Text').extract() }