如何与用户代理一起使用 Wget 下载网页
我正在尝试使用 Wget 下载此页面。这是页面链接:
并且这是我的命令:
wget -O ebay.html --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rt=nc&item=250972882769&si=a8iGAIchyvEbn7KveYFZ5QbEE7o%3D&print=all&category=31387"
当我使用它使用浏览器访问页面时,它可以工作 美好的。当我使用 Wget 时,它会下载另一个页面,而不是原始页面。我认为问题出在用户代理上。解决办法是什么?
I am trying to download this page using Wget. Here is the page link:
And here is my cmd:
wget -O ebay.html --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rt=nc&item=250972882769&si=a8iGAIchyvEbn7KveYFZ5QbEE7o%3D&print=all&category=31387"
When I use it to access the page using a browser it works fine. When I use Wget, it downloads another page, not the original one. I think the problem is for user-agent. What's the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不在于用户代理,而在于缺少 cookie。解决方案是
我使用随机产品页面尝试了它;它起作用了。
The problem isn't user-agent, it's a missing cookie or cookies. The solution is
I tried it with a random product page; it worked.