I have an HTML page on which several links are there, I want to click one link and that will download relevant file for me. How do I simulate this using curl. All links have different name attribute

closed as unclear what you're asking by Caleb, jasonwryan, Anthon, slm, peterph Jun 23 '14 at 13:28

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Wait, you want to click a link, and have that link downloaded with curl? Why? I mean, it might be doable through browser modification, but I don't know why you would want that. – HalosGhost Jun 23 '14 at 7:11
  • I dint get the meaning of browser modification, I just need to do this using cURL script – SAR Jun 23 '14 at 7:15
  • 1
    So… you don't want to click the link, you just want to do this in a shell script? – HalosGhost Jun 23 '14 at 7:16
  • Also, can you show us the web page? With what you've said so far, I don't believe your question will garner helpful responses. – HalosGhost Jun 23 '14 at 7:17
  • 1
    Can you give us an example, or a tutorial, or something? What you're posting (at least, to me) doesn't really make much sense. curl is a command-line utility. It can be used by graphical utilities, but then we would need to know which one. – HalosGhost Jun 23 '14 at 7:24

When you click a link in a browser it creates a http request with not only the path to the link but information such as to the identity of the browser, language, cookies and many other values the server may choose to use(or ignore).

This ignores the fact that the page may use javascript to react to the click.

curl will allow you generate a complete http request with all the same values as if it was created by the browser. Bottom line is the server will not be able to tell a well crafted curl request from a browser.

curl the command line utility does not interact directly with GUI applications like web browsers.

curl capabilities extends far beyond just sending http requests. I use it mainly to fake calls to web services from mobile apps.

You might like to also look at libcurl http://curl.haxx.se/ which could be added to other products that could interact with other apps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.