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 to use Python requests to fake a browser visit a.k.a and generate User Agent?

Provide a User-Agent header: import requests url=”http://www.ichangtou.com/#company:data_000008.html” headers = {‘User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36’} response = requests.get(url, headers=headers) print(response.content) FYI, here is a list of User-Agent strings for different browsers: List of all Browsers As a side note, there is a pretty useful third-party package called … Read more

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 …

How to get past the login page with Wget?

Based on the manual page: # Log in to the server. This only needs to be done once. wget –save-cookies cookies.txt \ –keep-session-cookies \ –post-data ‘user=foo&password=bar’ \ –delete-after \ http://server.com/auth.php # Now grab the page or pages we care about. wget –load-cookies cookies.txt \ http://server.com/interesting/article.php Make sure the –post-data parameter is properly percent-encoded (especially ampersands!) … Read more

wget/curl large file from google drive

June 2022 You can use gdown. Consider also visiting that page for full instructions; this is just a summary and the source repo may have more up-to-date instructions. Instructions Install it with the following command: pip install gdown After that, you can download any file from Google Drive by running one of these commands: gdown … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)