I am trying to scrape some information from https://seminovos.localiza.com/Paginas/resultado-busca.aspx?&yr=2014_2019&pc=25000_500000
In this webpage, next_page button has a href
with the following: 'javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl42$g_f221d036_75d3_4ee2_893d_0d7b40180245$ProximaPaginaSuperior", "", true, "", "", false, true))
I could do that easily with Selenium, but using scrapy, how can I go to the next page?
I tried something like:
next_page = response.xpath('.//a[@class="item option next"]/@href').extract_first()
if next_page:
self.log(next_page)
scrapy.http.FormRequest(response.url,formdata={"eventTarget":"ctl00$ctl42$g_f221d036_75d3_4ee2_893d_0d7b40180245$ProximaPaginaSuperior","eventArgument":"","validation":"true","validationGroup":"","actionUrl":"","trackFocus":"false","clientSubmit":"true"},callback=self.parse)
What is the proper way to navigate to next page on this situation?