Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- form_data = {
- 'Host': 'yweb.ymcaboston.org',
- 'Connection': 'keep-alive',
- 'Content-Length': '162',
- 'Cache-Control': 'max-age=0',
- 'Origin': 'https://yweb.ymcaboston.org',
- 'Upgrade-Insecure-Requests': '1',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36',
- 'Sec-Fetch-Dest': 'document',
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
- 'Sec-Fetch-Site': 'same-origin',
- 'Sec-Fetch-Mode': 'navigate',
- 'Sec-Fetch-User': '?1',
- 'Referer': 'https://yweb.ymcaboston.org/SpiritWeb/SearchClass',
- 'Accept-Encoding': 'gzip, deflate, br',
- 'Accept-Language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
- 'Cookie': 'JSESSIONID=B3EA74E806326E6A103E6AF6B4183B1D; _gcl_au=1.1.1607218088.1581862558; _ga=GA1.2.1529164039.1581862559; _gid=GA1.2.1585617269.1581862559; _fbp=fb.1.1581862558831.182947883; comm100_visitorguid_230425=1ae2a14b-d49a-45fc-806b-02d55c80e3c2; _gat_gtag_UA_119444777_1=1; _gat_UA-154305703-1=1'
- }
- class MachineSpider(scrapy.Spider):
- name = 'api'
- start_urls = ['https://yweb.ymcaboston.org/SpiritWeb/SearchClass']
- def start_requests(self):
- yield scrapy.FormRequest('https://yweb.ymcaboston.org/SpiritWeb/SearchClass',
- formdata={'EXECEVENT': 'ONSEARCH', 'SORTBY': 'AGE'},
- headers=form_data,
- callback=self.parse)
- def parse(self, response):
- print(response.body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement