Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class CardsSpider(scrapy.Spider):
- name = 'cards'
- #based_url='https://moneyfacts.co.uk/credit-cards/balance-transfer-credit-cards/?fbclid=IwAR05-Sa1hIcYTRx8DXYYQd0UfDRjWF-jD2-u51jiLP-WKlkxSddKjzUcnWA'
- def start_requests(self):
- yield scrapy.Request(
- url = 'https://moneyfacts.co.uk/umbraco/surface/CreditCardsFinder/GetTableItemsFor',
- callback = self.parse,
- method = "POST",
- headers = {
- 'content-type': 'application/x-www-form-urlencoded',
- 'x-requested-with': 'XMLHttpRequest'
- }
- )
- def parse(self, response):
- cards = json.loads(response.body)
Advertisement
Add Comment
Please, Sign In to add comment