On Linux, wget simulates browser download pages or files, or curl simulates browser access pages

Some websites only allow browser access. If you access directly on Linux without setting user-agent, you will be beeped~~

The following are wget and curl commands to simulate browser download and access.

wget --user-agent="Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" The address you want to download

curl --user-agent "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" The address you want to visit

ps: What? You want to know the version of the browser you are currently using, press f12, and enter navigator.userAgent in the console to see

Guess you like

Origin blog.csdn.net/weixin_37281289/article/details/104520836
Recommended