Wget recognizes some part of my URL address as a syntax error

The & has a special meaning in the shell. Escape it with \ or put the url in quotes to avoid this problem. wget http://search.yahoo.com/404handler?src=search\&p=food+delicious -O test.html or wget “http://search.yahoo.com/404handler?src=search&p=food+delicious” -O test.html In many Unix shells, putting an & after a command causes it to be executed in the background.

How to set proxy for wget?

For all users of the system via the /etc/wgetrc or for the user only with the ~/.wgetrc file: use_proxy=yes http_proxy=127.0.0.1:8080 https_proxy=127.0.0.1:8080 or via -e options placed after the URL: wget … -e use_proxy=yes -e http_proxy=127.0.0.1:8080 …

Using wildcards in wget or curl query

You can’t use wildcards in wget but the -A flag should work. From the wget manpage: You want to download all the gifs from a directory on an http server. You tried wget http://www.server.com/dir/*.gif, but that didn’t work because http retrieval does not support globbing. In that case, use: wget -r -l1 –no-parent -A.gif http://www.server.com/dir/ … Read more

How to download all files (but not HTML) from a website using wget?

To filter for specific file extensions: wget -A pdf,jpg -m -p -E -k -K -np http://site/path/ Or, if you prefer long option names: wget –accept pdf,jpg –mirror –page-requisites –adjust-extension –convert-links –backup-converted –no-parent http://site/path/ This will mirror the site, but the files without jpg or pdf extension will be automatically removed.

How do I download and save a file locally on iOS using objective C? [duplicate]

I’m not sure what wget is, but to get a file from the web and store it locally, you can use NSData: NSString *stringURL = @”http://www.somewhere.com/thefile.png”; NSURL *url = [NSURL URLWithString:stringURL]; NSData *urlData = [NSData dataWithContentsOfURL:url]; if ( urlData ) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = … Read more

Using WGET to run a cronjob PHP

You could tell wget to not download the contents in a couple of different ways: wget –spider http://www.example.com/cronit.php which will just perform a HEAD request but probably do what you want wget -O /dev/null http://www.example.com/cronit.php which will save the output to /dev/null (a black hole) You might want to look at wget’s -q switch too … Read more