문제

I would like to download data from this links

enter image description here

The tasks would be:

  1. download the winzip file
  2. unzip the file
  3. save it to specific location, lets say C:/data.

Although I have limited knowledge on html, I think the following html code is related to the form:

<tr class="downloadStatisticItem" Style="display: table-row;">

Thanks for your help.

도움이 되었습니까?

해결책

  1. I downloaded this file and link looks like this http://www.hactl.com/webapp/hactlpbf/pbfcontroller/HDCRDF;PBF_JSESSIONID=Pvl9TPbB7585NLhLTy9vKQTh9Mj42GW2P10LTVGHKnSwznRwwKy5!-315031026 so it might be hard to download this using R, since there is no static link. But you could try using postForm function from RCurl package like this

    postForm("www.hactl.com/en-US/Media-Centre/Cargo-Statistics.aspx",dateTo='Mar 2014', (insert here the rest of form inputs), style="POST")

  2. To unzip file use unzip function

  3. To copy file to specific location use file.copy function.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top