Skip to content

Instantly share code, notes, and snippets.

@eupendra
Created August 21, 2020 05:32
Show Gist options
  • Save eupendra/7ac89eb410e9d0067f52f950b1cf79d9 to your computer and use it in GitHub Desktop.
Save eupendra/7ac89eb410e9d0067f52f950b1cf79d9 to your computer and use it in GitHub Desktop.
import scrapy
from .config import API
from scraper_api import ScraperAPIClient
client = ScraperAPIClient(API)
class ApiSpider(scrapy.Spider):
name = 'api'
def start_requests(self):
for i in range(5):
yield scrapy.Request(client.scrapyGet(url='http://httpbin.org/ip?i='+str(i)))
def parse(self, response):
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment