Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
Support with scrapy. get data from a double Postback

I am looking for help with a specific problem to get data from a postback table. I need to access a table that is loaded after pressing a button with a JavaScript PostbackWithOption. I think I am using the incorrect request because the table is not loading. I notice that the Postback is nested in another postback and should be the reason I cannot get to the table. Any advice is well received

The table is under the "Transfers" window in this link https://www83.hattrick.org/en-us/Club/Players/Player.aspx?playerId=469061287

This is the code I am using now:

def transf_tab(self,response):
open_in_browser(response)
#This is the code in the webpage javascript: WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$CPContent$CPMain$btnViewTransferHistory", "", true, "", "", false, true))

transfToken = response.xpath('//*[@id="__VIEWSTATE"]/@value').extract_first()
target ="ctl00$ctl00$CPContent$CPMain$btnViewTransferHistory"
# viewstategen = "0C55417A"
data = {'__EVENTTARGET': target,'__VIEWSTATE': transfToken},
return FormRequest(url=response.url,
                 method= 'POST',
                 formdata=data,
                 dont_filter= True,
                 callback=self.parse_player)

def parse_player(self, response):
    open_in_browser(response)
    trsf_item = HtsellsItem()

I have been able to scrap different webs using postback, but this time, after running the FormRequest, the table is not loaded, and there is some "new information" and some other information missing too

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda