我需要帮助刮掉一个下载按钮与python+美丽的汤文本文件

2024-05-17 20:53:04 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我是一个非常新的刮和尝试做它与Python和美丽的汤。你知道吗

我需要得到这个网站上每副牌的文本文件http://magic.wizards.com/en/articles/archive/mtgo-standings/competitive-standard-constructed-league-2016-11-08

每副牌都有一个下载文本文件的小按钮。你知道吗

非常感谢!你知道吗


Tags: comhttp网站magicarticlesstandardenarchive
1条回答
网友
1楼 · 发布于 2024-05-17 20:53:04

他们正在下载按钮附近提交表格。按函数填写表单:

wiz_bean_content_deck_list_generate_file

因此,它需要从卡片中获取“h4”的innerHTML,并将其填充到“title”字段中,然后获取“.card count”和“.card name a”,并用新行将其连接到一个字符串中: output += count + " " + name + breakStr;。 因此,您可以使用字段向http://magic.wizards.com/decklist发出post请求(仅举一个例子):

title: Mogged%20(5-0)
content: 1%20Liliana%2C%20the%20Last%20Hope%5Bb%5D4%20Cryptbreaker%5Bb%5D4%20Haunted%20Dead%5Bb%5D4%20Insolent%20Neonate%5Bb%5D4%20Prized%20Amalgam%5Bb%5D4%20Scrapheap%20Scrounger%5Bb%5D4%20Voldaren%20Pariah%5Bb%5D4%20Cathartic%20Reunion%5Bb%5D4%20Fiery%20Temper%5Bb%5D2%20Lightning%20Axe%5Bb%5D2%20Unlicensed%20Disintegration%5Bb%5D4%20Foreboding%20Ruins%5Bb%5D5%20Mountain%5Bb%5D4%20Smoldering%20Marsh%5Bb%5D10%20Swamp%5Bb%5D%5Bb%5D%5Bb%5D1%20Lightning%20Axe%5Bb%5D1%20Liliana%2C%20the%20Last%20Hope%5Bb%5D1%20Unlicensed%20Disintegration%5Bb%5D3%20Collective%20Brutality%5Bb%5D3%20Distended%20Mindbender%5Bb%5D2%20Kalitas%2C%20Traitor%20of%20Ghet%5Bb%5D3%20Transgress%20the%20Mind%5Bb%5D1%20Vampiric%20Rites%5Bb%5D

你会拿到你的档案。 不要忘记填写标题:

X-DevTools-Emulate-Network-Conditions-Client-Id
Origin

没有他们,你会得到html页面'未登录'。你知道吗

相关问题 更多 >