Fazlul

Untitled

Jun 16th, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import scrapy
  2.  
  3. class CardsSpider(scrapy.Spider):
  4.  
  5. name = 'cards'
  6. #based_url='https://moneyfacts.co.uk/credit-cards/balance-transfer-credit-cards/?fbclid=IwAR05-Sa1hIcYTRx8DXYYQd0UfDRjWF-jD2-u51jiLP-WKlkxSddKjzUcnWA'
  7.  
  8. def start_requests(self):
  9. yield scrapy.Request(
  10. url = 'https://moneyfacts.co.uk/umbraco/surface/CreditCardsFinder/GetTableItemsFor',
  11. callback = self.parse,
  12. method = "POST",
  13. headers = {
  14. 'content-type': 'application/x-www-form-urlencoded',
  15. 'x-requested-with': 'XMLHttpRequest'
  16. }
  17. )
  18. def parse(self, response):
  19. cards = json.loads(response.body)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment