Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python - Scrapy Login form
#5
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()
            }
Reply


Messages In This Thread
Python - Scrapy Login form - by Baggelhsk95 - Oct-12-2018, 09:25 AM
RE: Python - Scrapy Login form - by stranac - Oct-12-2018, 04:18 PM
RE: Python - Scrapy Login form - by Baggelhsk95 - Oct-13-2018, 06:34 AM
RE: Python - Scrapy Login form - by stranac - Oct-13-2018, 02:27 PM
RE: Python - Scrapy Login form - by Baggelhsk95 - Oct-16-2018, 08:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using python within an html form t4keheart 5 5,481 Aug-17-2020, 12:28 PM
Last Post: t4keheart
  Python Scrapy Date Extraction Issue tr8585 1 3,331 Aug-05-2020, 04:32 AM
Last Post: tr8585
  Python Scrapy tr8585 2 2,390 Aug-04-2020, 04:11 AM
Last Post: tr8585
  Python Webscraping with a Login Website warriordazza 0 2,610 Jun-07-2020, 07:04 AM
Last Post: warriordazza
  How to perform a successful login(signin) through Requests in Python Kalet 1 2,359 Apr-24-2020, 01:44 AM
Last Post: Larz60+
  Automatic login hidden form Andra111 0 1,644 Mar-26-2020, 08:06 AM
Last Post: Andra111
  Posting value from excel to Form (Python+Selenium) revanth 0 1,813 Feb-05-2020, 10:44 AM
Last Post: revanth
  Python-selenium script for automated web-login does not work hectorKJ 2 4,100 Sep-10-2019, 01:29 PM
Last Post: buran
  HOWTO? Login DSL Modem with Python Requests: need Click "Apply" Button Webtest 4 8,526 Aug-20-2019, 04:03 PM
Last Post: johnmina
  Python - Scrapy Baggelhsk95 0 2,294 Apr-24-2019, 01:07 PM
Last Post: Baggelhsk95

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020