从终端下载与网页中的导出按钮关联的文件

时间:2018-03-12 17:21:27

标签: python r bash web web-scraping

我想通过点击" EXCEL Document"来下载生成的文件。终端右侧的此页面右侧的按钮。 是否有可能从unix bash中做到这一点? 在R内或使用python也没关系。

http://www.vivc.de/index.php?r=eva-analysis-mikrosatelliten-vivc%2Fresultmsatvar&EvaAnalysisMikrosatellitenVivcSearch%5Bleitname_list%5D=&EvaAnalysisMikrosatellitenVivcSearch%5Bleitname_list%5D%5B%5D=ABADI&EvaAnalysisMikrosatellitenVivcSearch%5BName_in_bibliography%5D=

由于

1 个答案:

答案 0 :(得分:0)

requests库可能正是您要找的。您需要将网址传递到requests.get

import requests
r = requests.get('http://google.com')
r.raise_for_status() # Will error out if there's an issue with the get request
print(r.content)

输出

<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for." name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><scr...