I'm trying to scrape data from this site using the scrapy https://www.superbancos.gob.pa/es/fin-y-est/reportes-estadisticos?field_ano_rep_est_value=2018
but the response I get is the following html response:
You are being redirected... Javascript is required. Please enable javascript before you are allowed to see this page.
I tried disabling the JavaScript from the Chrome Browser to see if I could get the same Scrapy Response, but it keep showing me the data.
I couldn't figure it out if I needed to change or add something to my settings.py
Could it be a Request Headers? or the agent?
class TestSpider(scrapy.Spider):
name = "test"
def start_requests(self):
url = 'https://www.superbancos.gob.pa/es/fin-y-est/reportes-estadisticos?field_ano_rep_est_value=2018'
yield scrapy.Request(url=url, callback=self.parse)
def parse(self, response):
page = response.url.split("/")[-2]
filename = 'report-%s.html' % page
with open(filename, 'wb') as f:
f.write(response.body)