支撑纸巾。从双回发获取数据

发布于 2025-02-10 17:36:24 字数 1247 浏览 2 评论 0原文

我正在寻找有关特定问题的帮助,以从回发表中获取数据。我需要访问使用JavaScript PostbackWithOption按下按钮后加载的表。我认为我正在使用不正确的请求,因为表未加载。我注意到寄回嵌套在另一个后备中,应该是我无法到达桌子的原因。任何建议都受到好评。

该链接在此链接的“转让”窗口下 https://www88.hattrick.org/club/players/player.aspx?playerid=470201347

这是我现在使用的代码:

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()

我已经能够刮除不同的网络使用后背,但是这次,在运行foldRequest后,该表未加载,并且还有一些“新信息”,还有一些其他信息缺失

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://www88.hattrick.org/Club/Players/Player.aspx?playerId=470201347

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文