Using wget to fake browser?

前端 未结 1 2014
情歌与酒
情歌与酒 2021-01-05 07:08

I\'d like to crawl a web site to build its sitemap.

Problems is, the site uses an htaccess file to block spiders, so the following command only downloads the homepag

1条回答
  •  北海茫月
    2021-01-05 07:39

    you might want to set the User-Agent to something more than just Mozilla, something like:

    wget --user-agent="Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"
    

    0 讨论(0)
提交回复
热议问题