我需要帮助从python +漂亮的汤

时间:2016-11-11 06:03:38

标签: python beautifulsoup

嗨,我很擅长刮痧,并试图用蟒蛇和美丽的汤来做。

我需要获取此网站http://magic.wizards.com/en/articles/archive/mtgo-standings/competitive-standard-constructed-league-2016-11-08

上每个套牌的文本文件

每个套牌都有一个下载文本文件的下载按钮。

非常感谢!

1 个答案:

答案 0 :(得分:0)

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

wiz_bean_content_deck_list_generate_file

所以,它得到" h4"的内部HTML。从卡片中填写“#34; title"字段并得到" .card-count"和#34; .card-name a"并使用新行将其连接到一个字符串: output += count + " " + name + breakStr;。 因此,您可以使用字段(仅示例)向http://magic.wizards.com/decklist发送请求后的信息:

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页面'未登录'。