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



大家好,我是一个刮痧的新手,尝试用蟒蛇和美丽的汤来做。

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

每个deck都有一个小的下载按钮,用于下载文本文件。

非常感谢!

他们在下载按钮附近提交表单。按功能填写表单:

wiz_bean_content_deck_list_generate_file

所以,它得到innerHTML的"h4"从卡和填充它到"title"字段,然后得到"。卡片计数"one_answers"。Card-name a",并将其连接到一个新的字符串:output += count + " " + name + breakStr;。因此,您可以通过字段(仅为示例)向http://magic.wizards.com/decklist发出post-request:

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

,你将得到你的文件。别忘了填充header:

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

没有他们,你会得到html页面'not logged in'。

最新更新